{"_id":"jb","_rev":"9-3b4c2a7c9aa2b2472f1df83d1a083a8a","name":"jb","description":"Simple JavaScript builder","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"jb","version":"0.0.1","description":"Simple JavaScript builder","main":"./lib/index.js","devDependencies":{"tap":"*"},"bin":{"jb":"./jb.js"},"dependencies":{"jc":"*","uglify-js":"*","optimist":"*"},"directories":{"test":"test"},"scripts":{"test":"node test"},"repository":{"type":"git","url":"https://github.com/jf7/jb/"},"keywords":["JavaScript","builder"],"author":{"name":"jf7"},"license":"BSD","gitHead":"859a6936bbb6f8c5310db40691eac93b22b23d72","_id":"jb@0.0.1","_from":".","dist":{"shasum":"d6636ce837c463408e7eb8a82dbe606bfa305772","tarball":"https://registry.npmjs.org/jb/-/jb-0.0.1.tgz","integrity":"sha512-RgcsocoiuvQZ8BrzPRIFBUWgdRTKShlCD0nM9lwj5FnLXP91kwdPxwqOKEjjDhtfxskHl+K+IZ9n0W5eKC1Ncg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEZVRLVmgYUq675y0Ha0CYK04FsaXbUPEb1Y7S24ZY61AiBDZSZAezWF6+u/H27nihHOHzZQvz4A7/4nQ4BvabVA3g=="}]},"_npmVersion":"1.2.15","_npmUser":{"name":"jf7","email":"jf7@nm.ru"},"maintainers":[{"name":"jf7","email":"jf7@nm.ru"}]}},"readme":"jb\r\n================================================================================\r\n\r\nSimple JavaScript builder\r\n\r\n## Description\r\n\r\n**jk** is a Node.JS module, providing Command Line Interface (and some library functions) for quick & easy compiling several client JavaScript-files into one.\r\n\r\nFeatures:\r\n\r\n* Support `import` and `include` instructions within modules code.\r\n* Code minification.\r\n\r\n## Installation\r\n\r\n    npm install -g jb\r\n\r\n## Example\r\n\r\nfile1.js:\r\n\r\n    module.name = 'MyName';\r\n\r\nfile2.js:\r\n\r\n    console.log('Hello, world!');\r\n\r\nindex.js:\r\n\r\n    var file1 = import('file1.js');\r\n    \r\n    include('file2.js');\r\n\r\nAfter execution command `jb index.js`, there will be `output.js` file with the following content:\r\n\r\n    var file1 = (function (module) {\r\n        module.name = 'MyName';\r\n        return module;\r\n    }({}));\r\n    \r\n    console.log('Hello, world!');\r\n\r\n## Build\r\n\r\nYou can provide to **jb** following build options:\r\n\r\n* `root`: Build's root directory (for `import` and `include` instructions). Default: `.`.\r\n* `filename`: Path to the root source file. Default: `index.js`.\r\n* `output`: Path to the output JavaScript file. Default: `output.js`.\r\n* `min`: If `true`, source code will be minified by UnglifyJS. Default: `false`.\r\n\r\n### Command line parameters\r\n\r\nBuild current directory with default options:\r\n\r\n    jb\r\n\r\nSpecify the root source file:\r\n\r\n    jb index.js\r\n\r\nOther parameters:\r\n\r\n    jb index.js --min --output my.js --root /home/my/project\r\n\r\n### build.json\r\n\r\nYou can save chosen parameters in `build.json` file in the build directory:\r\n\r\n    {\r\n        \"filename\": \"mySource.js\",\r\n        \"output\": \"my.js\",\r\n        \"min\": \"true\"\r\n    }\r\n\r\n**jb** finds `build.json` file in the current directory and loads it's parameters.\r\n\r\n## Documentation\r\n\r\n### Class: jk.Builder\r\n\r\n#### new Builder(options)\r\n\r\nConstructor. Returns `jk.Builder` instance.\r\n\r\n* `options.filename`: Path to the root source file.\r\n* `options.root`: Project's root directory.\r\n* `options.min`: Minification flag (`true`/`false`).\r\n* `options.output`: Path to the output file.\r\n\r\n#### config([options])\r\n\r\nSets or returns `options` object's properties.\r\n\r\n* `options`: Optional argument. If one not specified, the method just returns current `options` object with `filename`, `root`, `min` and `output` properties. If `options` is a string, the method returns current value of the specified property. If `options` is an object, the method sets specified properties.\r\n\r\n### build([output])\r\n\r\nCompiles source files and writes result to the output file.\r\n\r\n* `output`: Path to the output file (optional).","maintainers":[{"name":"teniryte","email":"teniryte@gmail.com"}],"time":{"modified":"2022-06-19T03:56:40.288Z","created":"2013-07-20T04:32:59.070Z","0.0.1":"2013-07-20T04:33:04.072Z"},"author":{"name":"jf7"},"repository":{"type":"git","url":"https://github.com/jf7/jb/"},"keywords":["JavaScript","builder"],"license":"BSD","readmeFilename":"README.md"}