{"_id":"copy-template-dir-ts","name":"copy-template-dir-ts","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"copy-template-dir-ts","version":"1.0.0","description":"High throughput template dir writes","author":{"name":"Alisson Cavalcante Agiani","email":"thelinuxlich@gmail.com"},"type":"module","scripts":{"build":"npx pkgroll","lint":"biome lint --apply src/*.ts","test":"NODE_ENV=test npm run build && tsx test/index.ts"},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"repository":{"type":"git","url":"git+https://github.com/thelinuxlich/copy-template-dir-ts.git"},"keywords":["template","directory","boilerplate","copy","concurrent"],"license":"MIT","devDependencies":{"@biomejs/biome":"^1.8.3","@types/node":"^20.14.10","rimraf":"^6.0.1","tsx":"^4.16.2","typescript":"^5.5.3"},"_id":"copy-template-dir-ts@1.0.0","gitHead":"bff82dcedb62efe75f4a903f88458e27421772ae","bugs":{"url":"https://github.com/thelinuxlich/copy-template-dir-ts/issues"},"homepage":"https://github.com/thelinuxlich/copy-template-dir-ts#readme","_nodeVersion":"20.15.1","_npmVersion":"10.7.0","dist":{"integrity":"sha512-JgxUr+ZxKtAyLs5J/IQvb8sFFFyK3woBNpZ6/Ey0TMSqYCztTyjs0cxO8oDt6srV9cvGaKYW//VlvOhOCrdrMg==","shasum":"b34f12857489a754f7c6ae7ae18c153362bca252","tarball":"https://registry.npmjs.org/copy-template-dir-ts/-/copy-template-dir-ts-1.0.0.tgz","fileCount":22,"unpackedSize":12681,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCP5KrStAeAOuEL1kxeVsHbfK41vka910xa6B/kyCGbTwIgMf00XCZVPo/eVrNMLXxCaqg1nzLcHVJa+GmSKhiN+T0="}]},"_npmUser":{"name":"thelinuxlich","email":"thelinuxlich@gmail.com"},"directories":{},"maintainers":[{"name":"thelinuxlich","email":"thelinuxlich@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/copy-template-dir-ts_1.0.0_1720798824768_0.6110695752362252"},"_hasShrinkwrap":false}},"time":{"created":"2024-07-12T15:40:24.767Z","1.0.0":"2024-07-12T15:40:24.911Z","modified":"2024-07-12T15:40:25.180Z"},"maintainers":[{"name":"thelinuxlich","email":"thelinuxlich@gmail.com"}],"description":"High throughput template dir writes","homepage":"https://github.com/thelinuxlich/copy-template-dir-ts#readme","keywords":["template","directory","boilerplate","copy","concurrent"],"repository":{"type":"git","url":"git+https://github.com/thelinuxlich/copy-template-dir-ts.git"},"author":{"name":"Alisson Cavalcante Agiani","email":"thelinuxlich@gmail.com"},"bugs":{"url":"https://github.com/thelinuxlich/copy-template-dir-ts/issues"},"license":"MIT","readme":"# copy-template-dir-ts\n\nThis is a rewrite of [copy-template-dir](https://github.com/yoshuawuyts/copy-template-dir) with TypeScript and ESM support.\n\nHigh throughput template dir writes. Supports variable injection using the\nmustache `{{ }}` syntax.\n\n## Installation\n```sh\n$ npm install copy-template-dir-ts\n```\n\n## Usage\n```js\nimport copy from 'copy-template-dir-ts'\nimport path from 'path'\n\nconst vars = { foo: 'bar' }\nconst inDir = path.join(process.cwd(), 'templates')\nconst outDir = path.join(process.cwd(), 'dist')\n\nconst createdFiles = copy(inDir, outDir, vars)\nfor (const file of createdFiles) {\n  console.log(`Created ${file}`)\n}\nconsole.log('done!')\n```\n\n## API\n### copyTemplateDir(templateDir, targetDir, vars)\nCopy a directory of files over to the target directory, and inject the files\nwith variables. Takes the following arguments:\n- __templateDir__: The directory that holds the templates. Filenames prepended\n  with a `_` will have it removed when copying. Dotfiles need to be prepended\n  with a `_`. Files and filenames are populated with variables using the\n  `{{varName}}` syntax.\n- __targetDir__: the output directory\n- __vars__: An object with variables that are injected into the template files\n  and file names.","readmeFilename":"README.md"}