How to use the mississippi.from.obj function in mississippi

To help you get started, we’ve selected a few mississippi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github npm / cacache / lib / entry-index.js View on Github external
function lsStream (cache) {
  const indexDir = bucketDir(cache)
  const stream = from.obj()

  // "/cachename/*"
  readdirOrEmpty(indexDir)
    .then((buckets) => {
      return Promise.all(
        buckets.map((bucket) => {
          const bucketPath = path.join(indexDir, bucket)

          // "/cachename//*"
          return readdirOrEmpty(bucketPath).then((subbuckets) => {
            return Promise.all(
              subbuckets.map((subbucket) => {
                const subbucketPath = path.join(bucketPath, subbucket)

                // "/cachename///*"
                return readdirOrEmpty(subbucketPath).then((entries) => {
github gulp-community / gulp-pug / test / stream.js View on Github external
it('should error if contents is a stream', function(done) {
    pipe([
      from.obj([file]),
      task(),
      concat(),
    ], (err) => {
      expect(err).toBeInstanceOf(PluginError);
      done();
    });
  });
});
github gulp-community / gulp-pug / test / filters.js View on Github external
it('should compile a pug template with a custom pug instance with filters', function(done) {
    function assert(files) {
      expect(files.length).toEqual(1);
      const newFile = files[0];
      expect(newFile).toMatchObject({
        contents: Buffer.from('HELLO, TESTER!!!!'),
      });
    }

    pipe([
      from.obj([getFixture('filters.pug')]),
      task(options),
      concat(assert),
    ], done);
  });
});
github gulp-community / gulp-pug / test / extends.js View on Github external
it('should compile a pug template with an extends', function(done) {
    function assert(files) {
      expect(files.length).toEqual(1);
      const newFile = files[0];
      expect(newFile).toMatchObject({
        contents: Buffer.from('<div><h1>Hello World</h1></div>'),
      });
    }

    pipe([
      from.obj([getFixture('extends.pug')]),
      task(),
      concat(assert),
    ], done);
  });
});
github gulp-community / gulp-pug / test / error.js View on Github external
it('should emit errors of pug correctly', function(done) {
    pipe([
      from.obj([getFixture('pug-error.pug')]),
      task(),
      concat(),
    ], (err) => {
      expect(err).toBeInstanceOf(PluginError);
      done();
    });
  });
});