{"_id":"make-empty-dir","_rev":"3290770","name":"make-empty-dir","description":"Ensures that a directory is empty","dist-tags":{"latest":"2.1.0","next":"1.1.0"},"maintainers":[{"name":"zkochan","email":"zoltan.kochan+github@gmail.com"}],"time":{"modified":"2024-05-23T06:50:45.000Z","created":"2020-04-25T17:10:38.544Z","2.1.0":"2023-08-19T10:36:58.989Z","2.0.0":"2021-04-11T12:30:52.269Z","1.1.0":"2021-02-11T22:53:32.538Z","1.0.0":"2020-04-25T17:10:38.544Z"},"users":{},"author":{"name":"Zoltan Kochan","url":"https://www.kochan.io"},"repository":{"type":"git","url":"git+https://github.com/zkochan/packages.git#main"},"versions":{"2.1.0":{"name":"make-empty-dir","version":"2.1.0","description":"Ensures that a directory is empty","main":"index.js","engines":{"node":">=12.10"},"repository":{"type":"git","url":"git+https://github.com/zkochan/packages.git#main"},"keywords":["directory","folder","mkdir","make-dir","empty"],"author":{"name":"Zoltan Kochan","url":"https://www.kochan.io"},"license":"MIT","homepage":"https://github.com/zkochan/packages/tree/main/make-empty-dir#readme","devDependencies":{"tape":"^5.3.2","tempy":"^1.0.1"},"dependencies":{"@zkochan/rimraf":"^2.1.3"},"scripts":{"test":"node test"},"types":"./index.d.ts","bugs":{"url":"https://github.com/zkochan/packages/issues"},"_id":"make-empty-dir@2.1.0","_integrity":"sha512-/Wd6YOLl+uCWzUq4z2pfqgEQCOXxoCIbVEnv5cAnA6wg9W0JTYLfjMyNeWzC0F6A24VVRh9VHmzJ6eA5wUBlLQ==","_resolved":"/private/var/folders/g7/5ygp0ncd6qx5g4fn5hpsqq5c0000gn/T/cb0865bb0b4323027292a706d88a6dc4/make-empty-dir-2.1.0.tgz","_from":"file:make-empty-dir-2.1.0.tgz","_nodeVersion":"16.20.0","_npmVersion":"9.7.1","dist":{"shasum":"bce31141338825d091754367d6d7f72c66e9934b","size":2095,"noattachment":false,"key":"/make-empty-dir/-/make-empty-dir-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/make-empty-dir/download/make-empty-dir-2.1.0.tgz"},"_npmUser":{"name":"zkochan","email":"z@kochan.io"},"directories":{},"maintainers":[{"name":"zkochan","email":"zoltan.kochan+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/make-empty-dir_2.1.0_1692441418837_0.6936447993212913"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-08-19T10:36:58.989Z","publish_time":1692441418989,"_source_registry_name":"default","_cnpm_publish_time":1692441418989},"2.0.0":{"name":"make-empty-dir","version":"2.0.0","description":"Ensures that a directory is empty","main":"index.js","scripts":{"test":"node test"},"engines":{"node":">=12.10"},"repository":{"type":"git","url":"https://github.com/zkochan/packages/tree/master/make-empty-dir"},"keywords":["directory","folder","mkdir","make-dir","empty"],"author":{"name":"Zoltan Kochan","url":"https://www.kochan.io"},"license":"MIT","homepage":"https://github.com/zkochan/packages/tree/master/make-empty-dir#readme","devDependencies":{"tape":"^5.1.1","tempy":"^1.0.0"},"dependencies":{"@zkochan/rimraf":"^2.1.0"},"_id":"make-empty-dir@2.0.0","_nodeVersion":"12.19.0","_npmVersion":"6.14.12","dist":{"shasum":"28e1b88f52df660aff5dc44941768390347e1a6a","size":2153,"noattachment":false,"key":"/make-empty-dir/-/make-empty-dir-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/make-empty-dir/download/make-empty-dir-2.0.0.tgz"},"_npmUser":{"name":"zkochan","email":"z@kochan.io"},"directories":{},"maintainers":[{"name":"zkochan","email":"zoltan.kochan+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/make-empty-dir_2.0.0_1618144252087_0.7530085772506756"},"_hasShrinkwrap":false,"publish_time":1618144252269,"_cnpm_publish_time":1618144252269},"1.1.0":{"name":"make-empty-dir","version":"1.1.0","description":"Ensures that a directory is empty","main":"index.js","scripts":{"test":"node test"},"engines":{"node":">=10.12"},"repository":{"type":"git","url":"https://github.com/zkochan/packages/tree/master/make-empty-dir"},"keywords":["directory","folder","mkdir","make-dir","empty"],"author":{"name":"Zoltan Kochan","url":"https://www.kochan.io"},"license":"MIT","homepage":"https://github.com/zkochan/packages/tree/master/make-empty-dir#readme","devDependencies":{"tape":"^5.1.1","tempy":"^1.0.0"},"dependencies":{"rimraf":"^3.0.2"},"readmeFilename":"README.md","_id":"make-empty-dir@1.1.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"shasum":"92894eba5d94dfa4ac4b78ff1ea5816ffd71140b","size":2143,"noattachment":false,"key":"/make-empty-dir/-/make-empty-dir-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/make-empty-dir/download/make-empty-dir-1.1.0.tgz"},"_npmUser":{"name":"zkochan","email":"z@kochan.io"},"directories":{},"maintainers":[{"name":"zkochan","email":"zoltan.kochan+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/make-empty-dir_1.1.0_1613084012402_0.07979356645093683"},"_hasShrinkwrap":false,"publish_time":1613084012538,"_cnpm_publish_time":1613084012538},"1.0.0":{"name":"make-empty-dir","version":"1.0.0","description":"Ensures that a directory is empty","main":"index.js","scripts":{"test":"node test"},"engines":{"node":">=10.12"},"repository":{"type":"git","url":"https://github.com/zkochan/packages/tree/master/make-empty-dir"},"keywords":["directory","folder","mkdir","make-dir","empty"],"author":{"name":"Zoltan Kochan","url":"https://www.kochan.io"},"license":"MIT","homepage":"https://github.com/zkochan/packages/tree/master/make-empty-dir#readme","devDependencies":{"tape":"^5.0.0","tempy":"^0.5.0"},"dependencies":{"graceful-fs":"^4.2.3","rimraf":"^3.0.2"},"_id":"make-empty-dir@1.0.0","_nodeVersion":"12.14.1","_npmVersion":"6.14.4","dist":{"shasum":"dad6c2d4cad13be9c039a8ec85c7ddaad10a69b2","size":2130,"noattachment":false,"key":"/make-empty-dir/-/make-empty-dir-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/make-empty-dir/download/make-empty-dir-1.0.0.tgz"},"maintainers":[{"name":"zkochan","email":"zoltan.kochan+github@gmail.com"}],"_npmUser":{"name":"zkochan","email":"z@kochan.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/make-empty-dir_1.0.0_1587834638295_0.5635745899979492"},"_hasShrinkwrap":false,"publish_time":1587834638544,"_cnpm_publish_time":1587834638544}},"readme":"# make-empty-dir\n\n> Ensures that a directory is empty\n\n[![npm version](https://img.shields.io/npm/v/make-empty-dir.svg)](https://www.npmjs.com/package/make-empty-dir)\n\nEnsures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted.\n\nIt works faster than `emptyDir()` of `fs-extra` because the contents of the directory are not read before the creation of the directory.\n\n## Installation\n\n```sh\n<npm|yarn|pnpm> add make-empty-dir\n```\n\n## Usage\n\n```js\n'use strict'\nconst makeEmptyDir = require('make-empty-dir')\n\nawait makeEmptyDir('dir-name')\n\n// or create the parent dir as well\nawait makeEmptyDir('dir/subdir', { recursive: true })\n```\n\n## API\n\n### `makeEmptyDir(dir: string, [opts]): Promise<'created' | 'emptied'>`\n\n**Arguments:**\n\n* `dir` - *Path* - the path of the directory.\n* `opts.recursive` - *Boolean* - Optional. If true, parent directories will be created.\n\n**Returns:**\n\nA string is returned.\n\n* `'created'` - if there was no directory\n* `'emptied'` - if there was a directory and the its contents were removed.\n\n## License\n\n[MIT](./LICENSE) © [Zoltan Kochan](https://www.kochan.io)\n","_attachments":{},"homepage":"https://github.com/zkochan/packages/tree/main/make-empty-dir#readme","bugs":{"url":"https://github.com/zkochan/packages/issues"},"license":"MIT"}