{"name":"export-files","description":"node.js utility for exporting a directory of files as modules.","version":"3.0.1","homepage":"https://github.com/jonschlinkert/export-files","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"funding":"https://github.com/sponsors/jonschlinkert","repository":{"type":"git","url":"git+https://github.com/jonschlinkert/export-files.git"},"bugs":{"url":"https://github.com/jonschlinkert/export-files/issues"},"license":"MIT","main":"index.js","engines":{"node":">=11"},"scripts":{"test":"mocha"},"devDependencies":{"gulp-format-md":"^2.0.0","mocha":"^8.3.2"},"keywords":["export","exports","file","files","module","modules"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"lint":{"reflinks":true}},"gitHead":"f24cbb3938905cd3b681f81f767447aec0dfe453","_id":"export-files@3.0.1","_nodeVersion":"16.4.2","_npmVersion":"7.18.1","dist":{"integrity":"sha512-MaTjHZIFh2PvN/kH7kjYfGWqb4LCPLPBq00pUMLKCcRrF9YpS/5YTRhKj2IQsH0UKeoWJW/ZBRyUsNW9LqkC+g==","shasum":"e9218e3876995f852b382f08484fa64dc601313b","tarball":"http://registry-npm.ywwl.com/export-files/download/export-files-3.0.1.tgz","fileCount":5,"unpackedSize":14304,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8Bs1CRA9TVsSAnZWagAAchkP/ihv8izaTCyjVgpmfzKp\nmsjFkasSwaDqBLctARbtESjlDhdwmFNOeLTq/oRJ0K/oegC/oYNnWqZAADqt\nqZTMyVc8KAt/xsNONs9r/W2iVeKMDlNxxoVlWOnzw/BkLcj0/XeUwmhTpkt6\nkEtMpTOi7yNRsQNTCnD6yVBEsZaxg34aIytQMF6LUeHEZojim2BrTUbpI6W8\nPg2TT1xC6CMhUKNXi7cy0UcIx+0Q2ZwOcojWp9Wqke5jIlvU8vN5dZz5QA05\n4yzYqkHBDcv0qqTkA+koFxd+cWjkVIcIoM80mu70Mj+C+/5vkF2tQWlc/ZA5\nD4RlRYhiknnKTFMaEWi4bAE4H+LqBswW18vp2qi5s1u4p97+Z35/UVaZTZiT\nw1vMK8RDYyASPJ+F8DwrsTJEY90ZqDztVRrnFmu3IiwvCt90z4A9ZChHVCt5\nZ4g7jlyDM8U20gRqmYu2Gnl3bUvrcUc7LlAKfdu0XZWosmylq+8j+1F0oT0U\nvv56G+eiludAB0GHDc9mS8caFI4VJUF43J93DyBLiQpjgAKbt+7PNVxzwrTG\nFAoHAbGlOG8iCJCScmSbErTvipV7ILuZy6qPuMsFHXg4h4xCW1J1GnTFfLWX\npKZusD1nfrcIaR5Oyqs9oEmWXTQeTtqbg1I9s1MR0fSRrNWdYFSOgAhRZvKU\nn6sF\r\n=KC23\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID4NcOPYdUcpaNnTXDG0U797QYJ/edtThF+tnOy4WSFMAiBEqzLjIVZaKHiUUahqhuCeE4RL/bL4x7+G9s3vNQZomg=="}],"size":5300,"noattachment":false,"key":"/export-files/-/export-files-3.0.1.tgz"},"_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"directories":{},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"},{"name":"doowb","email":"brian.woodward@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/export-files_3.0.1_1626348341231_0.08398013617400979"},"_hasShrinkwrap":false,"readme":"# export-files [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/jonathanschlinkert?locale.x=en_US) [![NPM version](https://img.shields.io/npm/v/export-files.svg?style=flat)](https://www.npmjs.com/package/export-files) [![NPM monthly downloads](https://img.shields.io/npm/dm/export-files.svg?style=flat)](https://npmjs.org/package/export-files) [![NPM total downloads](https://img.shields.io/npm/dt/export-files.svg?style=flat)](https://npmjs.org/package/export-files) [![Tests](https://github.com/jonschlinkert/export-files/actions/workflows/test.yml/badge.svg)](https://github.com/jonschlinkert/export-files/actions/workflows/test.yml)\n\n> node.js utility for exporting a directory of files as modules.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/) (requires [Node.js](https://nodejs.org/en/) >=10):\n\n```sh\n$ npm install --save export-files\n```\n\n## Heads up!\n\nCurrently this library only works with `require`.\n\n## Usage\n\nSpecify the directory with files to export:\n\n**Example**\n\nGiven that `__dirname` has three files, `a.js`, `b.js`, and `c.js`:\n\n```js\nmodule.exports = require('export-files')(__dirname);\n//=> { a: [getter], b: [getter], c: [getter] }\n```\n\nThe second argment may be an object to intialize with. This is useful when you want to use export-files to extend an existing object.\n\n```js\nconst utils = {};\nutils.doSomething = () => {};\nmodule.exports = require('export-files')(__dirname, utils);\n//=> { doSomething: [function], a: [getter], b: [getter], c: [getter] }\n```\n\n## Options\n\n### .ignoreDirs\n\nDirectories to ignore.\n\n**Type:** `string|array`\n\n**Default:** `['.git', 'node_modules', 'test', 'tmp', 'temp', 'vendor']`\n\n**Example**\n\nThe following examples shows how to override the default values and, in this case, not ignore any directories.\n\n```js\nconst requires = require('export-files');\nmodule.exports = requires(__dirname, undefined, { ignoreDirs: [] });\n```\n\n### .recursive\n\nRecurse into child directories.\n\n**Type:** `boolean`\n\n**Default:** `false`\n\n**Example**\n\n```js\nconst requires = require('export-files');\nmodule.exports = requires(__dirname, undefined, { recursive: true });\n```\n\n### .filter\n\nFunction to exclude files from the result.\n\n**Type:** `function`\n\n**Default:** Excludes files named `index.js`\n\n**Example**\n\n```js\nconst requires = require('export-files');\nmodule.exports = requires(__dirname, undefined, file => file.name !== 'a.js');\n```\n\n### .case\n\nModify the casing of keys for exported files.\n\n**Type:** `string`, `array<string>`, or `function`\n\n`.case` may be defined as a function to use custom casing on exported names.\n\nIf defined as an array or string, valid values are any of the following:\n\n* `stem` - the file name without modification, excluding file extension\n* `name` - alias for `stem`\n* `basename` - the full file name, including file extension\n* `pascal` - pasacal case `stem`, useful for class names\n* `camel` - camel case `stem`\n* `lower` - lower case `stem`\n* `snake` - snake case `stem`\n* `auto` - (default) attempts to automatically determine casing when exports might be a mixture of casings, like class names and camel case method names.\n\nYou may define multiple cases.\n\n**Default:** `auto`\n\n**Example**\n\n```js\nconst requires = require('export-files');\nmodule.exports = requires(__dirname, undefined, { case: ['camel', 'pascal'] });\n```\n\n## Changes\n\n**v3.0.0 - breaking changes**\n\n* Improvements were made to support recursion and renaming keys. See readme for more details and available options.\n\n**v0.2.0 - breaking changes**\n\n* Non-javascript files are no longer handled. That functionality was moved to [to-exports](https://github.com/jonschlinkert/to-exports). This decision was made to keep this lib as fast as possible.\n* This library no longer takes any arguments besides the directory to read.\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n</details>\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [export-dirs](https://www.npmjs.com/package/export-dirs): Export directories and their files as node.js modules. | [homepage](https://github.com/jonschlinkert/export-dirs \"Export directories and their files as node.js modules.\")\n* [file-reader](https://www.npmjs.com/package/file-reader): Read a glob of files, dynamically choosing the reader or requiring the files based on… [more](https://github.com/jonschlinkert/file-reader) | [homepage](https://github.com/jonschlinkert/file-reader \"Read a glob of files, dynamically choosing the reader or requiring the files based on the file extension.\")\n* [map-files](https://www.npmjs.com/package/map-files): Return an object for a glob of files. Pass a `rename` function for the keys… [more](https://github.com/jonschlinkert/map-files) | [homepage](https://github.com/jonschlinkert/map-files \"Return an object for a glob of files. Pass a `rename` function for the keys, or a `parse` function for the content, allowing it to be used for readable or require-able files.\")\n* [to-exports](https://www.npmjs.com/package/to-exports): Create exports from a directory of non-javascript or javascript files. | [homepage](https://github.com/jonschlinkert/to-exports \"Create exports from a directory of non-javascript or javascript files.\")\n\n### Contributors\n\n| **Commits** | **Contributor** |\n| --- | --- |\n| 43 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 4  | [doowb](https://github.com/doowb) |\n\n### Author\n\n**Jon Schlinkert**\n\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n\n### License\n\nCopyright © 2021, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 27, 2021._\n","publish_time":1626348341417,"_cnpm_publish_time":1626348341417,"dist-tags":{"beta":"1.2.0-beta","latest":"3.0.2"}}