{"name":"export-files","description":"node.js utility for exporting a directory of files as modules.","version":"0.1.3","homepage":"https://github.com/jonschlinkert/export-files","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/export-files.git"},"bugs":{"url":"https://github.com/jonschlinkert/export-files/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/export-files/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"benchmarked":"^0.1.3","mocha":"*","should":"*"},"keywords":["export","exports","file","files","module","modules"],"_id":"export-files@0.1.3","_shasum":"e94902071b09c7b58dc7977d6c9ab8708ce34a79","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"e94902071b09c7b58dc7977d6c9ab8708ce34a79","tarball":"http://registry-npm.ywwl.com/export-files/download/export-files-0.1.3.tgz","integrity":"sha512-hEHT/058MVN3KfqTnY16/SSnLzWcKR3ApP4GDiCVSqSsb4ESz2JYqFrOHEMBKCYmhfeH1r3EWkVt7DRshBN+dQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDw/FmHZKaFj/WQY1U+59+cF9vQepS7JRS7K+Umpg2xswIhAOmozGrHmXmPwKbmSSeq4RV4ilryk/lOgaiY6EAdIcUO"}],"size":2392,"noattachment":false,"key":"/export-files/-/export-files-0.1.3.tgz"},"directories":{},"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":1416041877238,"_cnpm_publish_time":1416041877238,"dist-tags":{"beta":"1.2.0-beta","latest":"3.0.2"}}