Closed balupton closed 10 years ago
:+1:
Here's a how-to guide:
https://gist.github.com/coolaj86/1318304
I did this once locally, so I have a package spec lying around. Here it is:
{
"bugs": {
"url": "https://github.com/asciidoctor/asciidoctor.js/issues"
},
"engines": {
"node": "*"
},
"name": "asciidoctor.js",
"contributors": [
{
"name": "Guillaume Grossetie",
"email": "ggrossetie@gmail.com"
}
],
"version": "0.1.2",
"licenses": [
{
"type": "MIT"
}
],
"keywords": [
"markup",
"processor",
"asciidoc"
],
"description": "AsciiDoc markup language processor",
"repository": {
"type": "git",
"url": "git://github.com/asciidoctor/asciidoctor.js.git"
},
"author": {
"name": "Dan Allen",
"email": "dan.j.allen@gmail.com"
},
"homepage": "http://asciidoctor.org",
"scripts": {},
"main": "./asciidoctor.js"
}
We'll get this done as soon as we cut a release (or a preview release) based on 1.5.0.
This is also a requirement for integrating asciidotor.js with assemble.io.
I am by no means a node expert, but from what I looked at w.r.t. creating a node module, more is required than simply defining the package.json. For instance the Opal.Asciidoctor
global will have to be shared via the node exports
[1].
Also, if we include the Opal global here, we could conceivably conflict with other Opal'ified libraries. There is a Opal npm module, but it seems out-of-date [2].
[1] http://howtonode.org/creating-custom-modules [2] https://npmjs.org/package/opal
I have just published 2 wrappers for Opal and Asciidoctor.js :
https://www.npmjs.org/package/opal-npm-wrapper https://www.npmjs.org/package/asciidoctorjs-npm-wrapper
Feedback are welcome
Resolved by @anthonny. Great work!
Done for 1.5.0 ;)
\o/
Would be great if you published this to npm. That way we could use this to accomplish bevry/docpad#599