- Installing Node.js on Mac OS X with Brew
- How does the Node.js search path work?
- How do I decide whether to install something locally or globaly?
- Look at OSC code
- Look at Andy Hall's Photoshop code
- Bare minimum Photoshop plugin
- Open terminal
- Type
brew install node
Loading modules from node_modules folders Loading modules from global folders
When you invoke the require()
command in a Node.js program, e.g.
var bk = require('buttkiss')
Node.js will search for the buttkiss
module using the following algorithm
- If the
buttkiss
is a native module, Node.js will just load it - you probably don't need to know any more than that - Node.js will search for the
buttkiss
module in./node_modules/
- Node.js will search for the
buttkiss
module in../node_modules/
- Node.js will continue searching for
buttkiss
in thenode_modules
folder by traversing upwards in the filesystem hierarchy - If the
$NODE_PATH
environment variable is set, then Node.js will search the paths delimited in that environment variable - Node.js will also search in
$HOME/.node_modules
,$HOME/.node_libraries
,$PREFIX/lib/node
- Any module that a project depends on should be expressed as a dependency in
package.json
, and will therefore be installed locally when you runnpm install
- Any module that is not a project dependency can be installed globally, e.g. a tool that watches your project for any filesystem changes and automatically runs your unit tests
- Enable remote connections in Photoshop, using password "password"
- Open terminal
cd ~
- Download generator-core with
git clone [email protected]:adobe-photoshop/generator-core
- Download buttkiss with
git clone [email protected]:maxenglander/buttkiss
- Install buttkiss with
cd generator-core; node app ../buttkiss