{"_id":"prepin","_rev":"5-be7041b08d86d0bbc11166e1cae42477","name":"prepin","description":"An in-place pre-processor for javascript files using C style pre-compile syntax to compose custom builds from npm-packages","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"prepin","version":"1.0.0","description":"An in-place pre-processor for javascript files using C style pre-compile syntax to compose custom builds from npm-packages","keywords":["builds","custom","inplace","preprocessor"],"license":"Unlicense","author":{"name":"commenthol","email":"commenthol@gmail.com"},"main":"src","bin":{"prepin":"./bin/prepin.js"},"directories":{"example":"example","test":"test"},"scripts":{"lint":"eslint '**/.js'","test":"mocha"},"dependencies":{},"devDependencies":{"mocha":"^3.4.2"},"gitHead":"e8b0ad6a7ca02b9df6eeee85b8444149ba0d1b18","_id":"prepin@1.0.0","_shasum":"c3c14b723d4ef2cc0fd4c3fc647df7edf37aa2df","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.3","_npmUser":{"name":"commenthol","email":"commenthol@gmail.com"},"dist":{"shasum":"c3c14b723d4ef2cc0fd4c3fc647df7edf37aa2df","tarball":"https://registry.npmjs.org/prepin/-/prepin-1.0.0.tgz","integrity":"sha512-wsxwhfPDG38HztW5GE0vn2gnv3xwk7jklsbLXLHOTXiq7cAdrtkVEZT4XZpJYyU7UQlbVtwDuHdVhUEBM5HVBQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCelWxWQL51O23VT+5M7hIwDmK25uT7DpOddG2gMmsGPQIhAPXcCn6WDo/vPcDCn5xmIcN898dYpC3Sq0rvUtG1ZpId"}]},"maintainers":[{"name":"commenthol","email":"commenthol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prepin-1.0.0.tgz_1497081106226_0.6822656020522118"}},"1.0.1":{"name":"prepin","version":"1.0.1","description":"An in-place pre-processor for javascript files using C style pre-compile syntax to compose custom builds from npm-packages","keywords":["builds","custom","inplace","preprocessor"],"homepage":"https://github.com/commenthol/prepin#readme","bugs":{"url":"https://github.com/commenthol/prepin/issues"},"license":"Unlicense","author":{"name":"commenthol","email":"commenthol@gmail.com"},"main":"lib","jsnext:main":"src","bin":{"prepin":"./bin/prepin.js"},"directories":{"example":"example","test":"test"},"repository":{"type":"git","url":"git+https://github.com/commenthol/prepin.git"},"scripts":{"all":"npm run transpile && npm test","lint":"eslint '**/.js'","test":"mocha","transpile":"babel -d lib src"},"babel":{"presets":["es2015"]},"dependencies":{},"devDependencies":{"babel-core":"^6.25.0","babel-preset-es2015":"^6.24.1","mocha":"^3.4.2"},"gitHead":"5bb3311e3a9b88f7e9d07a5a611fef7700ecc37f","_id":"prepin@1.0.1","_shasum":"cd41e027fd5b4cc28ce591639bb7b14d2f4f0618","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.3","_npmUser":{"name":"commenthol","email":"commenthol@gmail.com"},"dist":{"shasum":"cd41e027fd5b4cc28ce591639bb7b14d2f4f0618","tarball":"https://registry.npmjs.org/prepin/-/prepin-1.0.1.tgz","integrity":"sha512-rsXqmL6zZ2WSFN8P10j4gIEgTUoZCwiptrvl9HKxF4aujx3pxVI85UdZnxBHcjKw3j/ZEyhFLbTJjoztup2OxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCScv6iJbyfprc3cejQa4XxCR57AtwDC1W6gRKunHLP7gIhALqC9KuJbGihKBjQx0iMCsAKpyGRAnJsgN5FQO1/gfY1"}]},"maintainers":[{"name":"commenthol","email":"commenthol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prepin-1.0.1.tgz_1497120868684_0.12390975374728441"}},"1.0.3":{"name":"prepin","version":"1.0.3","description":"An in-place pre-processor for javascript files using C style pre-compile syntax to compose custom builds from npm-packages","keywords":["builds","custom","inplace","preprocessor"],"homepage":"https://github.com/commenthol/prepin#readme","bugs":{"url":"https://github.com/commenthol/prepin/issues"},"repository":{"type":"git","url":"git+https://github.com/commenthol/prepin.git"},"license":"Unlicense","author":{"name":"commenthol","email":"commenthol@gmail.com"},"main":"lib","jsnext:main":"src","bin":{"prepin":"./bin/prepin.js"},"directories":{"lib":"lib","example":"example","test":"test"},"scripts":{"all":"npm-run-all clean lint build test","build":"babel -d lib src","clean":"rimraf lib","lint":"eslint src test","prepublishOnly":"npm run all","test":"mocha"},"babel":{"presets":["env"]},"eslintConfig":{"extends":"standard","plugins":["standard"]},"dependencies":{},"devDependencies":{"babel-cli":"^6.26.0","babel-core":"^6.26.3","babel-preset-env":"^1.7.0","babel-register":"^6.26.0","eslint":"^5.16.0","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.17.2","eslint-plugin-node":"^9.0.1","eslint-plugin-promise":"^4.1.1","eslint-plugin-standard":"^4.0.0","mocha":"^6.1.4","npm-run-all":"^4.1.5","rimraf":"^2.6.3"},"gitHead":"010d239c5cc8fcbf4321b54e6802c589394e5847","_id":"prepin@1.0.3","_nodeVersion":"12.1.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-0XL2hreherEEvUy0fiaGEfN/ioXFV+JpImqIzQjxk6iBg4jQ2ARKqvC4+BmRD8w/pnpD+lbxvh0Ub+z7yBEjvA==","shasum":"6996d34f1f8bf0de0bacf525e3037da79b7df91b","tarball":"https://registry.npmjs.org/prepin/-/prepin-1.0.3.tgz","fileCount":10,"unpackedSize":15665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc1ZVsCRA9TVsSAnZWagAA0f4P/2jDhxQSA4t6DZl3+B5P\n7O5ekpoq5ytN3OgU0V1aiTE9DCNSMOrd53jpXbfEinSKcirz9s1yZVD1QUXu\ncTfhelry9Z2JsxGF3bIsHvV71BrmF5L3x8IVDUxzsd06bFZhv4/Dd1ApSJwS\naXE+xtw/w9P5hwFyR8HFUoneiH1x+iofKcmASfRjWfxv6lMB9o7MqzQ9mycB\niZRkyo7OfwNnFaouTbJDiOlygxq2gsimg+3U07RF3FW+WvB7+E/vpwWokz1x\nnglsEmFSLhIoUiHONtBXnNTtpQADIj0lxnrMbYSOwqGHnKl82oTkYLU/GrML\nMt5IleryMuCuXgJJU8uoDsxPdX72JaxIjTKA8r1UfpKRtze6xEjaL0DtUmWo\nfK0XC3mVJNoJ3QFCRKKZ0gdFvsGJYAxUUGbTq7cS/MqxO38T4qApHAeTAebp\nVkiKj4BBgQ6W91hcLB2tQnh558cK5eDEPaD6ubFFgN1OS0hPO8pwEEWkZno8\nHxj5O8AHsFE2nXW8YMfAS5z98LJ0xxGDG4UHpzxLrkG1S09UwRkPNg3lbzNA\nVw3ceIaObhCs69JcTHtjreDjBgY9Iqn6t7rrajerGbKENJkmI313WORphTWg\nWT0+xqsO2uOzeYuM7EG6PsZaUlMuhiD70IEinGh1Ast9oeHFlr3ciTxDWaVp\nvUJ8\r\n=eSqN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHYBJTTwd4B+jUqA5BLF3/Ir5V7CAuH4JbzfKmYy3Ka4AiEAsqzK/fdk/seNlWtvNI6FtRoZo11PSY+Z9sxzKS8h3JM="}]},"maintainers":[{"name":"commenthol","email":"commenthol@gmail.com"}],"_npmUser":{"name":"commenthol","email":"commenthol@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prepin_1.0.3_1557501292073_0.13790863641290318"},"_hasShrinkwrap":false}},"readme":"# prepin\n\n> An in-place pre-processor for javascript files using C style pre-compile\nsyntax to compose custom builds from npm-packages.\n\n[![NPM version][badge]][repo]\n\nPre-processors found on [npm][] require a different file for outputting\nprocessed changes. This is not ideal for in-place custom builds on already\npublished packages. This pre-processors main purpose is to allow reduction of\npackage size for e.g. single-page apps on not requiring modules based on macros\ngiven at transpile time.\n\n## Syntax\n\nFollows C style pre-compiler syntax but requires `//` right in front to work in\n.js files.\n\n```\n// #if expression             // e.g. // #if macro == 1\n// #if defined(macro)\n// #ifdef macro\n// #ifndef macro\n// #elif expression           // e.g. // #elif macro == 2\n// #else\n// #endif\n// # is a commented line\n```\n\n## Example\n\nLet's assume a `example/sample.js` file, which includes a package of large size which is\nrequired for a specific task is not used in a smaller custom build...\n\nThe original file:\n\n```js\n// #ifndef small\nconst big = require('./big-package')\n// #else\n// # let big // define the alternative\n// #endif\n\nif (big) {\n  // ...\n}\n```\n\nIf processing with `prepin -m small sample.js` you'll get:\n\n```js\n// #ifndef small\n// # const big = require('./big-package')\n// #else\nlet big // define the alternative\n// #endif\n\nif (big) {\n  // ...\n}\n```\n\n## CLI\n\n```\nprepin [options] [file]\n\nOptions:\n\n  -m macro=1    define macro\n  -o <output>   write output to file\n\nExamples:\n\n  cat sample.js | prepin -m small\n      reads from stdin and transpiles using macro \"small\", writes to stdout.\n\n  prepin -m small=1 -m other sample.js\n      pre-process with macros small=1, other on sample.js\n```\n\n## API\n\n```js\nconst Prepin = require('prepin')\n\nconst opts = {macros: {small: true}, input: 'sample.js', output: 'sample.js'}\n\nnew Prepin(opts).proc().catch((e) => console.error(e))\n```\n\n## License\n\n[UNLICENSE][]\n\n[badge]: https://badge.fury.io/js/prepin.svg\n[repo]: https://www.npmjs.com/package/prepin\n\n[npm]: https://npmjs.org\n[UNLICENSE]: http://unlicense.org\n","maintainers":[{"name":"commenthol","email":"commenthol@gmail.com"}],"time":{"modified":"2022-06-24T14:20:53.151Z","created":"2017-06-10T07:51:47.429Z","1.0.0":"2017-06-10T07:51:47.429Z","1.0.1":"2017-06-10T18:54:29.562Z","1.0.3":"2019-05-10T15:14:52.198Z"},"keywords":["builds","custom","inplace","preprocessor"],"author":{"name":"commenthol","email":"commenthol@gmail.com"},"license":"Unlicense","readmeFilename":"README.md","homepage":"https://github.com/commenthol/prepin#readme","repository":{"type":"git","url":"git+https://github.com/commenthol/prepin.git"},"bugs":{"url":"https://github.com/commenthol/prepin/issues"}}