{"_id":"nodefy","_rev":"167923","name":"nodefy","description":"convert AMD modules into a node.js compatible format","dist-tags":{"latest":"0.2.2"},"maintainers":[{"name":"millermedeiros","email":""}],"time":{"modified":"2021-06-03T11:48:19.000Z","created":"2012-11-20T02:02:44.451Z","0.2.2":"2013-03-05T14:16:28.590Z","0.2.1":"2012-11-21T12:54:55.482Z","0.2.0":"2012-11-20T13:55:08.243Z","0.1.0":"2012-11-20T02:02:44.451Z"},"users":{"millermedeiros":true},"author":{"name":"Miller Medeiros","url":"http://blog.millermedeiros.com/"},"repository":{"type":"git","url":"https://github.com/millermedeiros/nodefy.git"},"versions":{"0.2.2":{"name":"nodefy","version":"0.2.2","description":"convert AMD modules into a node.js compatible format","main":"index.js","directories":{"test":"test"},"scripts":{"test":"./node_modules/.bin/jasmine-node test"},"repository":{"type":"git","url":"https://github.com/millermedeiros/nodefy.git"},"keywords":["amd","cjs","modules","convert"],"author":{"name":"Miller Medeiros","url":"http://blog.millermedeiros.com/"},"dependencies":{"esprima":">= 1.0 <1.2","glob":"~3.1.14","async":"~0.1.22","commander":"~1.1.0","mkdirp":"~0.3.4"},"devDependencies":{"jasmine-node":"~1.0.26"},"bin":{"nodefy":"bin/nodefy"},"engine":{"node":">= 0.8"},"license":"MIT","_id":"nodefy@0.2.2","dist":{"shasum":"da2fadc0e035be3b9652905c8f7a05930e90b468","size":4618,"noattachment":false,"key":"/nodefy/-/nodefy-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/nodefy/download/nodefy-0.2.2.tgz"},"maintainers":[{"name":"millermedeiros","email":""}],"publish_time":1362492988590,"_cnpm_publish_time":1362492988590,"_hasShrinkwrap":false},"0.2.1":{"name":"nodefy","version":"0.2.1","description":"convert AMD modules into a node.js compatible format","main":"index.js","directories":{"test":"test"},"scripts":{"test":"./node_modules/.bin/jasmine-node test"},"repository":{"type":"git","url":"https://github.com/millermedeiros/nodefy.git"},"keywords":["amd","cjs","modules","convert"],"author":{"name":"Miller Medeiros","url":"http://blog.millermedeiros.com/"},"dependencies":{"esprima":">= 1.0 <1.2","glob":"~3.1.14","async":"~0.1.22","commander":"~1.1.0","mkdirp":"~0.3.4"},"devDependencies":{"jasmine-node":"~1.0.26"},"bin":{"nodefy":"bin/nodefy"},"engine":{"node":">= 0.8"},"license":"MIT","_id":"nodefy@0.2.1","dist":{"shasum":"36306d5dc9621750a283baedcc5729fb77a8a29c","size":4006,"noattachment":false,"key":"/nodefy/-/nodefy-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/nodefy/download/nodefy-0.2.1.tgz"},"maintainers":[{"name":"millermedeiros","email":""}],"publish_time":1353502495482,"_cnpm_publish_time":1353502495482,"_hasShrinkwrap":false},"0.2.0":{"name":"nodefy","version":"0.2.0","description":"convert AMD modules into a node.js compatible format","main":"index.js","directories":{"test":"test"},"scripts":{"test":"./node_modules/.bin/jasmine-node test"},"repository":{"type":"git","url":"https://github.com/millermedeiros/nodefy.git"},"keywords":["amd","cjs","modules","convert"],"author":{"name":"Miller Medeiros","url":"http://blog.millermedeiros.com/"},"dependencies":{"esprima":">= 1.0 <1.2","glob":"~3.1.14","async":"~0.1.22","commander":"~1.1.0"},"devDependencies":{"jasmine-node":"~1.0.26"},"bin":{"nodefy":"bin/nodefy"},"engine":{"node":">= 0.8"},"license":"MIT","_id":"nodefy@0.2.0","dist":{"shasum":"d75e28c5ed5ef6f6599f0d8e51272118ece84b21","size":6028,"noattachment":false,"key":"/nodefy/-/nodefy-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/nodefy/download/nodefy-0.2.0.tgz"},"maintainers":[{"name":"millermedeiros","email":""}],"publish_time":1353419708243,"_cnpm_publish_time":1353419708243,"_hasShrinkwrap":false},"0.1.0":{"name":"nodefy","version":"0.1.0","description":"convert AMD modules into a node.js compatible format","main":"index.js","directories":{"test":"test"},"scripts":{"test":"./node_modules/.bin/jasmine-node test"},"repository":{"type":"git","url":"https://github.com/millermedeiros/nodefy.git"},"keywords":["amd","cjs","modules","convert"],"author":{"name":"Miller Medeiros","url":"http://blog.millermedeiros.com/"},"dependencies":{"esprima":">= 1.0 <1.2","glob":"~3.1.14","async":"~0.1.22","commander":"~1.1.0"},"devDependencies":{"jasmine-node":"~1.0.26"},"bin":{"nodefy":"bin/nodefy"},"engine":{"node":">= 0.8"},"license":"MIT","_id":"nodefy@0.1.0","dist":{"shasum":"783af9373fde5625f6ed98071465125a9fe74afd","size":5317,"noattachment":false,"key":"/nodefy/-/nodefy-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/nodefy/download/nodefy-0.1.0.tgz"},"maintainers":[{"name":"millermedeiros","email":""}],"publish_time":1353376964451,"_cnpm_publish_time":1353376964451,"_hasShrinkwrap":false}},"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## 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","_attachments":{},"license":"MIT"}