{"_id":"@dword-design/babel-plugin-wildcard","_rev":"2-a36ca005e9d68025dc9e767206c117c4","name":"@dword-design/babel-plugin-wildcard","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@dword-design/babel-plugin-wildcard","version":"0.0.1","description":"`import` now works with directories","main":"lib/index.js","scripts":{"build":"babel -d ./lib ./src","prepublish":"babel -d ./lib ./src","test":"node test"},"publishConfig":{"access":"public"},"bin":{"bpwc":"index.js"},"repository":{"type":"git","url":"git+https://github.com/vihanb/babel-plugin-wildcard.git"},"author":{"name":"Vihan B","email":"vihan@vihan.org","url":"vihan.org"},"license":"MIT","bugs":{"url":"https://github.com/vihanb/babel-plugin-wildcard/issues"},"homepage":"https://github.com/vihanb/babel-plugin-wildcard#readme","devDependencies":{"babel-cli":"^6.18.0","babel-preset-es2015":"^6.18.0","chalk":"^1.1.3","clear":"0.0.1","diff":"^3.0.1"},"dependencies":{"rimraf":"^2.6.2"},"gitHead":"a25cd866409b1f0361efb4293207547d5b9a48ee","_id":"@dword-design/babel-plugin-wildcard@0.0.1","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-JRWyw3Ddk6RHqaEee75IGG42p/oBYRcrPtBu5ExKV2rMktk5K25koUGyiyvXemcvzTZ3I1/dOn+89W/DpKGSAg==","shasum":"37636b4894fc62839bfa16c9f6c69ba0c222eca7","tarball":"https://registry.npmjs.org/@dword-design/babel-plugin-wildcard/-/babel-plugin-wildcard-0.0.1.tgz","fileCount":47,"unpackedSize":24176,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcwFYgNLDdoMiCKFAEt3V9eyOLl9E9gdoX/Q9I9kCGUgIgV0b9/DG1tXfG67uOm4SXadx9i7Q9Aev+r51/klFmnKk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJji6pEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp41RAAgcos/Hmp09BkHfBAQP0iyDcT7e39pWSY7NT5cgYf2w1xtUnt\r\ngu+j+X8Zcyhjc8f2b6PwSxMTi0rArsOFVah1vCmMqbAMeD4F5b3m91kCD4OL\r\nnD1uVbFeDU/7/TQVy5HmfV6dz7XZhzaXgC86FirK2QFk1XyJwIXRTZbeCACQ\r\nm3WaHsRoZ8O/2DWMc+8PgA8ZrGDiOPp9SrXDevGqJ4S+PQLKxMtTQDs0oRyD\r\n+fkTIC8Okx4HSxtGibphclN0E10S9MmydQ7C7yQf5o1JrT/cmpyjRr/8VJYW\r\nfMarxujqeOJiqjlsCyg09jBXfSw82DlV/oQbabB6LYqZyw/rjoEOkzzZWKjV\r\nDzOo/ncwQZA4w4C0RHg8DViSIN4/9V2fJ/Ih5NAVUSr8VNIZ6M/2YdhfPcCH\r\n+Py657hVFLtSL3lY9Nf0l+axsgu45lDhbkEWLCPe9W5gbwjsyaRbDZWz3YkT\r\nyIyPq+dILafrya9jTU4atf+JpKBuEOwtSBue8pxMzShKG718LVDD0jiMS/d5\r\nbWz8vh13KqJ7rNvzZ7hwHFUfXeUbZORa1E0fUOyXmwayjgwmRunngZtNzany\r\n/i+XVMCmBpheDVLIv2r3q4O53LgMcuQV5lycWEkSqo9Hujs70tw1EpbUMk4T\r\nkycckAn3bjrYVK05PsY8yUJUD7KMBC6lklY=\r\n=qgpg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dword-design","email":"info@sebastianlandwehr.com"},"directories":{},"maintainers":[{"name":"dword-design","email":"info@sebastianlandwehr.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-plugin-wildcard_0.0.1_1670097476141_0.012251249239684014"},"_hasShrinkwrap":false},"0.0.2":{"name":"@dword-design/babel-plugin-wildcard","version":"0.0.2","description":"`import` now works with directories","main":"lib/index.js","scripts":{"build":"babel -d ./lib ./src","prepublish":"babel -d ./lib ./src","test":"node test"},"publishConfig":{"access":"public"},"bin":{"bpwc":"index.js"},"repository":{"type":"git","url":"git+https://github.com/vihanb/babel-plugin-wildcard.git"},"author":{"name":"Vihan B","email":"vihan@vihan.org","url":"vihan.org"},"license":"MIT","bugs":{"url":"https://github.com/vihanb/babel-plugin-wildcard/issues"},"homepage":"https://github.com/vihanb/babel-plugin-wildcard#readme","devDependencies":{"babel-cli":"^6.18.0","babel-preset-es2015":"^6.18.0","chalk":"^1.1.3","clear":"0.0.1","diff":"^3.0.1"},"dependencies":{"rimraf":"^2.6.2"},"gitHead":"a25cd866409b1f0361efb4293207547d5b9a48ee","_id":"@dword-design/babel-plugin-wildcard@0.0.2","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-jC+voQeWQ1TNH6H2Qb5F+EKnPy9fA23pxkmd6ISkYBSf/9udu+oXE9nBp1oAc0GVZUvX1CrFDQlWoW4xaACXsQ==","shasum":"5434601315a3c7912d40435f76d1d333e220c958","tarball":"https://registry.npmjs.org/@dword-design/babel-plugin-wildcard/-/babel-plugin-wildcard-0.0.2.tgz","fileCount":47,"unpackedSize":24431,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBGzhiPyNGCdUmY39crV2hsZXWSPsKSxTYmntJ2d9k9iAiArW/KYFgBjatZ7Gk0g2DiEFSslxz+wBLdIdXKOSseMzg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJji60MACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoz0w//WxfVsF89asHnhO/smuNbTWrnuieINdELhGgOI8yBjVgcSEDk\r\nZJpq4FPiGbo1RGspGFgcWafuTZVlcF8rBDxmZTXvl2w3pRug2pCEj2gQjT2D\r\n4TDsQ5m3j1+9WU52DaEl6HMw+v4hSIgXwZ9+/TURzAV2sXMacWvlYEfPusMv\r\nqjNK5OZv9a+SvOb0Vo80ok6Ya4MKhb7ZEWiU+IHVMsKLCqYbjKLUtnvA/uzO\r\nHSJ56Qcs01axQfwLjghkYDNM/BXOITYshHiQ42w3qOCUFbR515wr5lHUX8lB\r\n2UbaFO6KKQdRVZQOXNWGG1g9GSMw3QeLGaJaHSIHsxTbjAtS5Ctt9gV/xAuK\r\nKd0RZqN+MFG9Xz2o5QKRkRBvvWmsS1GJrOKxI0Lgvadk1zsyVHLE1vbK8AVM\r\ndOZ3AFPbAWOMxitRUo6v1nXtVOu2iYdZXRiMwwu4dbNafktgJNb8jSh5p4Gb\r\n4r7Wenvj8/Tb/OjhbWtAKpCqNBxULdhy4yPADhymhbx+2mGCbPj7zaNXqGLa\r\nMGXSU05UMvHknTBH88Jt4bDXqlqoHjIbKxr4UjCOCPMFGtV4OyTebv11+6vN\r\naV1xmp9zWXmtsDvu8CE6ywUS8AhOrsUkXKE6AeEQ7L6+bEeQi4bfbKcnOP8s\r\nY/Bw4svOvmF2XfWxQ9XIum3d+7eSCi7OSLI=\r\n=hYZU\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dword-design","email":"info@sebastianlandwehr.com"},"directories":{},"maintainers":[{"name":"dword-design","email":"info@sebastianlandwehr.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-plugin-wildcard_0.0.2_1670098188616_0.381114814937608"},"_hasShrinkwrap":false},"0.0.3":{"name":"@dword-design/babel-plugin-wildcard","version":"0.0.3","description":"`import` now works with directories","main":"lib/index.js","scripts":{"build":"babel -d ./lib ./src","prepublish":"babel -d ./lib ./src","test":"node test"},"publishConfig":{"access":"public"},"bin":{"bpwc":"index.js"},"repository":{"type":"git","url":"git+https://github.com/vihanb/babel-plugin-wildcard.git"},"author":{"name":"Vihan B","email":"vihan@vihan.org","url":"vihan.org"},"license":"MIT","bugs":{"url":"https://github.com/vihanb/babel-plugin-wildcard/issues"},"homepage":"https://github.com/vihanb/babel-plugin-wildcard#readme","devDependencies":{"babel-cli":"^6.18.0","babel-preset-es2015":"^6.18.0","chalk":"^1.1.3","clear":"0.0.1","diff":"^3.0.1"},"dependencies":{"rimraf":"^2.6.2"},"gitHead":"a25cd866409b1f0361efb4293207547d5b9a48ee","_id":"@dword-design/babel-plugin-wildcard@0.0.3","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-J+OooxCchKZbU9cKvlWQFc9tDc0NipACWGadLE2JKRBJJcL4e/+3yFwrwestjn9yBk+JEq1FEzRSXi38FXWrag==","shasum":"58ee9a9f0be24f5066edff0de769170940b8ff1a","tarball":"https://registry.npmjs.org/@dword-design/babel-plugin-wildcard/-/babel-plugin-wildcard-0.0.3.tgz","fileCount":47,"unpackedSize":24248,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDUeg6LI36RgF/Cf6zKitTD2tmqNAZg76YXhLKQu49ezAiBRZpPVL5ZcE+WTdTv4qA/TjN8l7ZA6Tdq+a2ryCRT8lQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJji6+gACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrrzA/7BHJa4KziRcq+iIftmscHh4VuBr/2N/So8AJlE8Xpk9/3P6rR\r\nScO6qb1RTOGstjBgwSAxTZRlXL61efrKttYj/MXJMHTltFSqgnUbXRl3JSoO\r\nGWlNZJ/KZQ7SpgdIPStoNvDphmYAr2IGZ+iDuc1MxL0MK+SGfEJz2JDsGAqT\r\n8Oo/9L6tH9O2zT+SedKgrJZ4hTucR96mfTb36/4O+xs+SDUF24sTTfWuDUlu\r\nGhuke9d0JNNHC/zZdScxnj1bAg8gqHH4fPIpMxSr2YApjfswlTyZGrGMb5RT\r\nEF/7sgzBoo3OfEU8fhwy4xKhPZtks3B7zyIDHqQqQxjQFKLGz4qOuABnZEfO\r\njYPi1wgjuSmXbunE4Le3n1rjJrB1z9z5UKky+VZtB0pGg4Cyld6KMJFch8wL\r\nVy9B+m0ghTb85XxuE5gbLGl8unuBonBmIAb6L8Lzx+dyZOlz82eUX2MShsaE\r\nH5Uw5H8fmCaFTUc3AIkrk6F5hF0es90FDRltPhwPTfKTv6VKgFWFXnuUfOe1\r\nj7ldKw6ECCXof5NCvmLJQAYZIYRJzVCPmcdnBYUYn7rohgYFMULeC1M7YHYv\r\nIBeq9UiuUMyKTOO01BgQe/2JuKSHbIpQjAG1kj+QoEt+3iiUki+Ctww1ArXr\r\ndgihYBx+oI5OnY3ztrAFBXaA4DRcdpxAg60=\r\n=3CfU\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dword-design","email":"info@sebastianlandwehr.com"},"directories":{},"maintainers":[{"name":"dword-design","email":"info@sebastianlandwehr.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-plugin-wildcard_0.0.3_1670098848749_0.8268863674361033"},"_hasShrinkwrap":false}},"time":{"created":"2022-12-03T19:57:56.076Z","0.0.1":"2022-12-03T19:57:56.324Z","modified":"2022-12-03T20:20:49.054Z","0.0.2":"2022-12-03T20:09:48.793Z","0.0.3":"2022-12-03T20:20:48.959Z"},"maintainers":[{"name":"dword-design","email":"info@sebastianlandwehr.com"}],"description":"`import` now works with directories","homepage":"https://github.com/vihanb/babel-plugin-wildcard#readme","repository":{"type":"git","url":"git+https://github.com/vihanb/babel-plugin-wildcard.git"},"author":{"name":"Vihan B","email":"vihan@vihan.org","url":"vihan.org"},"bugs":{"url":"https://github.com/vihanb/babel-plugin-wildcard/issues"},"license":"MIT","readme":"# babel-plugin-wildcard\n\nAllows you to `import` all files from a directory at compile-time.\n\n## Installation\n\n```sh\n$ npm install babel-plugin-wildcard\n```\n\n## Usage\n\n### Via `.babelrc` (Recommended)\n\n**.babelrc**\n\n```json\n{\n  \"plugins\": [\"wildcard\"]\n}\n```\n\n### Via CLI\n\n```sh\n$ babel --plugins include script.js\n```\n\n### Via Node API\n\n```javascript\nrequire('babel').transform('code', {\n  plugins: ['wildcard']\n});\n```\n\n## Example\n\nWith the following folder structure:\n\n```\n|- index.js\n|- dir\n    |- a.js\n    |- b.js\n    |- c.js\n```\n\nthe following JS:\n\n```javascript\nimport * as Items from './dir';\n```\n\nwill be compiled to:\n\n```javascript\nconst Items = {};\nimport _wcImport from \"./dir/a\";\nItems.A = _wcImport;\nimport _wcImport1 from \"./dir/b\";\nItems.B = _wcImport1;\nimport _wcImport2 from \"./dir/c\";\nItems.C = _wcImport2;\n```\n\nmeaning you will be able to access the items using `Items.A` and `Items.B`.\n\n---\n\nYou can also selectively choose files using:\n\n```javascript\nimport { A, C } from \"dir/*\";\n```\n\nwhich in the above example would convert to:\n\n```\nimport A from \"./dir/a\";\nimport C from \"./dir/c\";\n```\n\nThe above is like doing:\n\n```\nimport * as temp from \"dir\";\nconst { A, C } = temp;\n```\n\n---\n\nThere is also simple Glob support so given the directory structure:\n\n```\n|- index.js\n|- dir\n    |- a.js\n    |- a.spec.js\n    |- b.js\n    |- b.spec.js\n```\n\nthis import:\n\n```javascript\nimport * as tests from './dir/*.spec';\n```\n\nwill compile to:\n\n```javascript\nimport aSpec from './dir/a.spec';\nimport bSpec from './dir/b.spec';\n```\n\n---\n\nFiles are automatically camel-cased and in the `import` statements the extensions are clipped unless specified otherwise (see below)\n\n## Information\n\n - File extensions are removed in the resulting variable. Dotfiles will be imported without their preceding `.` (e.g. `.foo` -> `Foo` or `foo` depending on settings)\n - in an `import { ... } from 'foo/*'`, the identifiers inside { ... } are the same as what their name\n would be if you were to import the whole directory. This means it is the files' names' pascal/camel-cased and extensions removed etc. by default (depending on settings of course).\n\n## Options\n\n`babel-plugin-wildcard` allows you to change various settings by providing an options object by using the following instead:\n\n```javascript\n{\n    plugins: [\n        ['wildcard', { options }]\n    ]\n}\n```\n\nwhere `{ options }` is the options object. The following options are available:\n\n### `exts`\nBy default, the files with the following extensions: `[\"js\", \"es6\", \"es\", \"jsx\"]`, will be imported. You can change this using:\n\n```javascript\n{\n    plugins: [\n        ['wildcard', {\n            'exts': [\"js\", \"es6\", \"es\", \"jsx\", \"javascript\"]\n        }]\n    ]\n}\n```\n\nIf you add the extension `\"\"`, it will also import subdirectories.\n\n### `nostrip`\nBy default, the file extension will be removed in the generated `import` statements, you can change this using:\n\n```javascript\n{\n    plugins: [\n        ['wildcard', {\n            'nostrip': true\n        }]\n    ]\n}\n```\n\nThis is useful when the extension of your source files is different from the outputted ones. (e.g. `.jsx` to `.js`).\n\n### `useCamelCase`\nBy default the name is converted to PascalCase, if you prefer camelCase, you may set this option to true:\n\n```\n{\n    plugins: [\n        ['wildcard', {\n            'useCamelCase': true\n        }]\n    ]\n}\n```\n\n### `noModifyCase`\nBy default, the name will be automatically pascal cased, the following regex is used to extract the words, those words then have their first letter capitalized and are joined together:\n\n```\n[A-Z][a-z]+(?![a-z])|[A-Z]+(?![a-z])|([a-zA-Z\\d]+(?=-))|[a-zA-Z\\d]+(?=_)|[a-z]+(?=[A-Z])|[A-Za-z0-9]+\n```\n\nyou can disable this behavior using:\n\n```javascript\n{\n    plugins: [\n        ['wildcard', {\n            'noModifyCase': true\n        }]\n    ]\n}\n```\n\nExtensions are still removed (except dotfiles, see \"Information\").\n","readmeFilename":"README.md"}