2012.11.21

nodefy: convert AMD modules to node.js

I’ve been using amd-utils on almost all my projects and sometimes I find myself wanting to use some of the methods on my node.js programs as well, so I decided to write a tool to convert the modules automatically.

The tool uses Esprima internally so it will keep the indentation, comments and it should work as long as the code can be parsed by Esprima. It will do as few replacements as possible to avoid undesired side effects.

Check the project repository for more info and please use the issue tracker for feature requests, bug reports and questions/feedback.

Related


Comments

Now this is interesting! I've been trying to figure out what to do with a lib similar to your amd-utils. This is something I wrote to use with Node and lately I've been wanting to use that with frontend side too.

At first I thought it might make sense just to add some UMD kludges around. Your approach is way nicer. I think I'll convert the whole source to use AMD definition just like yours (might do micromodules while at it) and then use nodefy to get the whole work in Node.

Thanks a lot for this tool! :)

Leave a Comment

Please post only comments that will add value to the content of this page. Please read the about page to understand the objective of this blog and the way I think about it. Thanks.

Comments are parsed as Markdown and you can use basic HTML tags (a, blockquote, cite, code, del, em, strong) but some code may be striped if not escaped (specially PHP and HTML tags that aren't on the list). Line and paragraph breaks automatic. Code blocks should be indented with 4 spaces.