{"_id":"fs-mkdirp-stream","_rev":"3943841","name":"fs-mkdirp-stream","description":"Ensure directories exist before writing to them.","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"phated","email":"blaine.bublitz@gmail.com"},{"name":"yocontra","email":""}],"time":{"modified":"2025-09-01T01:32:41.000Z","created":"2017-05-14T00:04:31.877Z","2.0.1":"2022-09-22T20:25:40.758Z","2.0.0":"2022-08-31T00:19:44.441Z","1.0.0":"2017-05-14T00:04:31.877Z"},"users":{},"author":{"name":"Gulp Team","email":"team@gulpjs.com","url":"https://gulpjs.com/"},"repository":{"type":"git","url":"git+https://github.com/gulpjs/fs-mkdirp-stream.git"},"versions":{"2.0.1":{"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":{"shasum":"1e82575c4023929ad35cf69269f84f1a8c973aa7","size":3430,"noattachment":false,"key":"/fs-mkdirp-stream/-/fs-mkdirp-stream-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/fs-mkdirp-stream/download/fs-mkdirp-stream-2.0.1.tgz"},"_npmUser":{"name":"phated","email":"blaine.bublitz@gmail.com"},"directories":{},"maintainers":[{"name":"phated","email":"blaine.bublitz@gmail.com"},{"name":"yocontra","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-mkdirp-stream_2.0.1_1663878340591_0.32297953692933"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-09-22T20:26:06.514Z","publish_time":1663878340758,"_cnpm_publish_time":1663878340758},"2.0.0":{"name":"fs-mkdirp-stream","version":"2.0.0","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":"55e5f67dd083c2bf0f3f393bab6b5fadbe78716c","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.0","_nodeVersion":"16.14.2","_npmVersion":"8.11.0","dist":{"shasum":"99ca45cc99de9c0d9353c690f81a36a0cb24c548","size":3387,"noattachment":false,"key":"/fs-mkdirp-stream/-/fs-mkdirp-stream-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fs-mkdirp-stream/download/fs-mkdirp-stream-2.0.0.tgz"},"_npmUser":{"name":"phated","email":"blaine.bublitz@gmail.com"},"directories":{},"maintainers":[{"name":"phated","email":"blaine.bublitz@gmail.com"},{"name":"yocontra","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-mkdirp-stream_2.0.0_1661905184281_0.5847661393020149"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-08-31T00:19:47.200Z","publish_time":1661905184441,"_cnpm_publish_time":1661905184441},"1.0.0":{"name":"fs-mkdirp-stream","version":"1.0.0","description":"Ensure directories exist before writing to them.","author":{"name":"Gulp Team","email":"team@gulpjs.com","url":"http://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":">= 0.10"},"main":"index.js","files":["LICENSE","index.js","mkdirp.js"],"scripts":{"lint":"eslint index.js mkdirp.js test/ && jscs index.js mkdirp.js test/","pretest":"npm run lint","test":"mocha --async-only","cover":"istanbul cover _mocha --report lcovonly","coveralls":"npm run cover && istanbul-coveralls"},"dependencies":{"graceful-fs":"^4.1.11","through2":"^2.0.3"},"devDependencies":{"eslint":"^1.10.3","eslint-config-gulp":"^2.0.0","expect":"^1.20.2","istanbul":"^0.4.3","istanbul-coveralls":"^1.0.3","jscs":"^2.4.0","jscs-preset-gulp":"^1.0.0","mississippi":"^1.3.0","mocha":"^3.2.0","rimraf":"^2.6.1"},"keywords":["fs","mkdirp","stream","mkdir","directory","directories","ensure"],"gitHead":"3a27851dc08f43dbe2d3fda2dddef34c67408715","bugs":{"url":"https://github.com/gulpjs/fs-mkdirp-stream/issues"},"homepage":"https://github.com/gulpjs/fs-mkdirp-stream#readme","_id":"fs-mkdirp-stream@1.0.0","_shasum":"0b7815fc3201c6a69e14db98ce098c16935259eb","_from":".","_npmVersion":"2.15.2","_nodeVersion":"0.10.41","_npmUser":{"name":"phated","email":"blaine.bublitz@gmail.com"},"maintainers":[{"name":"phated","email":"blaine.bublitz@gmail.com"},{"name":"yocontra","email":""}],"dist":{"shasum":"0b7815fc3201c6a69e14db98ce098c16935259eb","size":3241,"noattachment":false,"key":"/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fs-mkdirp-stream/download/fs-mkdirp-stream-1.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/fs-mkdirp-stream-1.0.0.tgz_1494720270021_0.31096577271819115"},"directories":{},"publish_time":1494720271877,"_hasShrinkwrap":false,"_cnpm_publish_time":1494720271877}},"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","_attachments":{},"homepage":"https://github.com/gulpjs/fs-mkdirp-stream#readme","bugs":{"url":"https://github.com/gulpjs/fs-mkdirp-stream/issues"},"license":"MIT"}