can i use mootools on the serverside with nodejs?
If so, can someone give an example?
Out of date: http://davidwalsh.name/mootools-nodejs
The correct way now is via the npm, which is actually upto date.
npm install mootools --save
using it:
require("mootools");
// globals exported and types shimmed
var foo = new Class({}); // etc
things not exported: Element protos, Fx, Slick (and parser), Request (XHR), Swiff etc - if it touches the DOM, it won't be there.
Still, given the JS implementation under nodejs is pretty awesome anyway, shimming is not required (other than some sugar methods) and for Class, you can use prime
- npm install prime
- see https://github.com/mootools/prime/
example on RequireBin: http://requirebin.com/?gist=5957603
Just to update this. If you have NPM installed you can just run:
npm install mootools
Then at the top of your node file just include:
require('mootools')
Source: https://github.com/vsviridov/mootools-node
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With