{"name":"fs-mkdirp-stream","version":"2.0.1","description":"Ensure directories exist before writing to them.","author":{"name":"Gulp Team","email":"team@gulpjs.com","url":"https://gulpjs.com/"},"contributors":[{"name":"Blaine Bublitz","email":"blaine.bublitz@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/gulpjs/fs-mkdirp-stream.git"},"license":"MIT","engines":{"node":">=10.13.0"},"main":"index.js","scripts":{"lint":"eslint .","pretest":"npm run lint","test":"nyc mocha --async-only"},"dependencies":{"graceful-fs":"^4.2.8","streamx":"^2.12.0"},"devDependencies":{"eslint":"^7.32.0","eslint-config-gulp":"^5.0.1","eslint-plugin-node":"^11.1.0","expect":"^27.4.2","mocha":"^8.4.0","nyc":"^15.1.0","readable-stream":"^3.6.0","rimraf":"^3.0.2","sinon":"^12.0.1"},"nyc":{"reporter":["lcov","text-summary"]},"prettier":{"singleQuote":true},"keywords":["fs","mkdirp","stream","mkdir","directory","directories","ensure"],"gitHead":"13e59eeea3c163ed5edf0b8069387c7ee8cf82a6","bugs":{"url":"https://github.com/gulpjs/fs-mkdirp-stream/issues"},"homepage":"https://github.com/gulpjs/fs-mkdirp-stream#readme","_id":"fs-mkdirp-stream@2.0.1","_nodeVersion":"16.14.2","_npmVersion":"8.11.0","dist":{"integrity":"sha512-UTOY+59K6IA94tec8Wjqm0FSh5OVudGNB0NL/P6fB3HiE3bYOY3VYBGijsnOHNkQSwC1FKkU77pmq7xp9CskLw==","shasum":"1e82575c4023929ad35cf69269f84f1a8c973aa7","tarball":"http://registry-npm.ywwl.com/fs-mkdirp-stream/download/fs-mkdirp-stream-2.0.1.tgz","fileCount":5,"unpackedSize":8790,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBYwCDLZujo/b4vTtYgp2TBG8YZzMLSBV190I7033wf6AiAaz0gUYJt01wNg7iYTD3hJSoGt2XkvOErExk6w6ckBgg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLMTEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGYg/+LWHpMOeeuMUpthh4RosDnHV0s/vK2LffBT53JjFdyuy6VVbL\r\nW733Z0DBYcpLqT2vU3ogW89ElsanjSGUD3o1/+NgpUr47uxv1+8qXnZQSvcu\r\nRho+ZOvHJCPClQ7SWmqBXdh7uphlg1ecVZm29ysxB7uVGv8vufVQHux5ESEG\r\nub4l9WK2ZZRCKjwXz3bUcDeZI+f2y/TAPP1N0yXSBLhlO8tsdfLUVTPcrGZC\r\nMC5VwW48DaQw8CRhPwhQJaSCvLCzOGl2Sk+Df62Z6+zbwyh2FrWiiCnDTUrX\r\nUEpalgKRSe//o2YOyIRMsjxiYcTcd7csPJFsEcbXhIXLlxAuDg92uKG5N8r/\r\nzZPvlzj851uGLMjRF5f1vTlK4WLjkIfMEkvD/Gl6tuQdj7GcdmCJa1smHdYz\r\nfyuaJ0tLxdZL9ahS2zCrjSm3hSnXwCAzmyY5L+bkb1fMA8EQATPUCVOtn+XX\r\n+C9TVL3BA2pOHcNurFLWVxxp17nbHZGePG/AnAb1oZws5vCwknGB0JhxaBaZ\r\nwID2j8K/DeRMnkmEo+ny7b2u4Iy8EoaELR5OitJVJFhoJDePc8YNhwpbdR4i\r\nybRS3PhiQYN5nC1PF45VKvwOtkffMix/kwTBou63tsGi5QzHchOxZ2SOeK2j\r\n6d6OhB/AzWjYj9LnRNaRWveumnuV/lIY1Rs=\r\n=d6/4\r\n-----END PGP SIGNATURE-----\r\n","size":3430,"noattachment":false,"key":"/fs-mkdirp-stream/-/fs-mkdirp-stream-2.0.1.tgz"},"_npmUser":{"name":"phated","email":"blaine.bublitz@gmail.com"},"directories":{},"maintainers":[{"name":"yocontra","email":"yo@contra.io"},{"name":"phated","email":"blaine.bublitz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-mkdirp-stream_2.0.1_1663878340591_0.32297953692933"},"_hasShrinkwrap":false,"readme":"<p align=\"center\">\n  <a href=\"https://gulpjs.com\">\n    <img height=\"257\" width=\"114\" src=\"https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png\">\n  </a>\n</p>\n\n# fs-mkdirp-stream\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]\n\nEnsure directories exist before writing to them.\n\n## Usage\n\n```js\nvar { Readable, Writable } = require('streamx');\nvar mkdirpStream = require('fs-mkdirp-stream');\n\nReadable.from([{ dirname: './path/to/my/', path: './path/to/my/file.js' }])\n  .pipe(\n    mkdirpStream(function (obj, callback) {\n      // callback can take 3 arguments (err, dirname, mode)\n      callback(null, obj.dirname);\n    })\n  )\n  .pipe(\n    new Writable({\n      write: function (obj, cb) {\n        // This will be called once the directory exists\n        // obj === { dirname: '/path/to/my/', path: '/path/to/my/file.js' }\n        cb();\n      },\n    })\n  );\n```\n\n## API\n\n### `mkdirpStream(resolver)`\n\nTakes a `resolver` function or string and returns a `streamx.Transform` stream.\n\nIf the `resolver` is a function, it will be called once per chunk with the signature `(chunk, callback)`. The `callback(error, dirpath, mode)` must be called with the `dirpath` to be created as the 2nd parameter or an `error` as the 1st parameter; optionally with a `mode` as the 3rd parameter.\n\nIf the `resolver` is a string, it will be created/ensured for each chunk (e.g. if it were deleted between chunks, it would be recreated). When using a string, a custom `mode` can't be used.\n\n## License\n\nMIT\n\nContains a custom implementation of `mkdirp` originally based on https://github.com/substack/node-mkdirp (Licensed MIT/X11 - Copyright 2010 James Halliday) with heavy modification to better support custom modes.\n\n<!-- prettier-ignore-start -->\n[downloads-image]: https://img.shields.io/npm/dm/fs-mkdirp-stream.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/fs-mkdirp-stream\n[npm-image]: https://img.shields.io/npm/v/fs-mkdirp-stream.svg?style=flat-square\n\n[ci-url]: https://github.com/gulpjs/fs-mkdirp-stream/actions?query=workflow:dev\n[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/fs-mkdirp-stream/dev?style=flat-square\n\n[coveralls-url]: https://coveralls.io/r/gulpjs/fs-mkdirp-stream\n[coveralls-image]: https://img.shields.io/coveralls/gulpjs/fs-mkdirp-stream/master.svg?style=flat-square\n<!-- prettier-ignore-end -->\n","publish_time":1663878340758,"_cnpm_publish_time":1663878340758,"dist-tags":{"latest":"2.0.1"}}