{"bin":{"nodefy":"bin/nodefy"},"dist":{"shasum":"da2fadc0e035be3b9652905c8f7a05930e90b468","tarball":"https://registry.npmjs.org/nodefy/-/nodefy-0.2.2.tgz","integrity":"sha512-GV6yvRaPIe50ZloGbG464rmBf+3TWY5ihxFispOo7Up/dMET8xIZOKlWwCf7bz/fhx5JBlIQBnmBrZI+v+O4SQ==","signatures":[{"sig":"MEQCICVbwAljwVAtLlO8VCV5w82Jvr5GfJj5pwhRul+RrconAiA3pkpOLtZdPKXftX6jM7Q9lq8mVZ0sXaG7nz2y8ehTAA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","name":"nodefy","author":{"url":"http://blog.millermedeiros.com/","name":"Miller Medeiros"},"engine":{"node":">= 0.8"},"readme":"# nodefy\n\nconvert AMD modules into a node.js compatible format.\n\n\n\n## How?\n\nThis tool uses [Esprima](http://esprima.org/) to parse the code and replace\n`define()` calls, doing the less amount of changes as possible to the code.\n\n### Input\n\n```js\ndefine(['foo', '../bar/baz'], function(foo, baz){\n\n    var lorem = 'ipsum';\n\n    return {\n        log : function(){\n            console.log(lorem);\n        }\n    };\n\n});\n```\n\n### Output\n\n```js\n    var foo = require('foo');\n    var baz = require('../bar/baz');\n\n    var lorem = 'ipsum';\n\n    module.exports = {\n        log : function(){\n            console.log(lorem);\n        }\n    };\n```\n\n\n## CLI\n\nYou can use it as a CLI tool:\n\n    [sudo] npm install -g nodefy\n    nodefy -o cjs \"src/**.js\"\n\nThis will convert all \".js\" files inside the `src` folder and put the results\non the `cjs` folder.\n\nIt also works with `stdin` and `stdout`:\n\n    cat \"src/foo.js\" | nodefy\n\nFor a list of available options run:\n\n    nodefy -h\n\n\n## Standalone Lib\n\nIt is also available as a regular node.js library.\n\n```js\nvar nodefy = require('nodefy');\n\n// nodefy.parse(string)\n// returns node.js style module\nvar cjsModule = nodefy.parse(jsString);\n\n// nodefy.convert(inputPath [, outputPath], callback)\n// if outputPath is omitted it won't write the result\nnodefy.convert('foo.js', function(err, result){\n    console.log(result);\n});\n\n// nodefy.batchConvert(glob [, outputFolder], callback)\n// if outputFolder is omitted it won't write the result\nnodefy.batchConvert('src/**.js', 'cjs', function(err, results){\n    // results is an array of {sourcePath, outputPath, result}\n});\n```\n\n\n## Inspiration / Why?\n\nI couldn't find any tool that did what I wanted - convert AMD modules into\nplain node.js - so I decided to code my own. There are alternatives but they\nall add more complexity than I wanted.\n\nThis project was created mainly because of\n[amd-utils](http://millermedeiros.github.com/amd-utils/), since many methods\nare useful on both environments.\n\nThe name was inpired by\n[browserify](https://github.com/substack/node-browserify).\n\n\n\n## Features, Goals & Limitations\n\nThe [Asynchronous Module\nDefinition](https://github.com/amdjs/amdjs-api/wiki/AMD) is very flexible, it\nsupports [plugins](https://github.com/amdjs/amdjs-api/wiki/Loader-Plugins),\nmany [configuration\nsettings](https://github.com/amdjs/amdjs-api/wiki/Common-Config) to define how\nmodules should be loaded and asynchronous module loading.\n\n**This tool aims to convert basic modules**, plugins and advanced settings\nprobably are NOT going to be supported in the near future (I have plans to\nsupport basic configs, see [issue 6](https://github.com/millermedeiros/nodefy/issues/6)).\nCheck the [uRequire](https://github.com/anodynos/uRequire) project in case you need\nsomething more complex or create a new feature request on the [issues\ntracker](https://github.com/millermedeiros/nodefy/issues).\n\n\n\n## Alternatives\n\n - [amdefine](https://github.com/jrburke/amdefine)\n - [UMD](https://github.com/umdjs/umd)\n - [r.js](https://github.com/jrburke/r.js)\n - [uRequire](https://github.com/anodynos/uRequire)\n\n\n## License\n\nReleased under the MIT license\n\n","license":"MIT","scripts":{"test":"./node_modules/.bin/jasmine-node test"},"keywords":["amd","cjs","modules","convert"],"repository":{"url":"https://github.com/millermedeiros/nodefy.git","type":"git"},"description":"convert AMD modules into a node.js compatible format","directories":{"test":"test"},"maintainers":[{"name":"millermedeiros","email":"miller@millermedeiros.com"}],"dependencies":{"glob":"~3.1.14","async":"~0.1.22","mkdirp":"~0.3.4","esprima":">= 1.0 <1.2","commander":"~1.1.0"},"devDependencies":{"jasmine-node":"~1.0.26"},"_id":"nodefy@0.2.2","version":"0.2.2"}