Closed jbenet closed 10 years ago
require(module)
.try { regular transformer require } catch (e) { try global require }
(doesn't satisfy "local cli not using global modules")This is pretty much solved. See how transformer-loader does it. Turns out the simple solution works great. I added a -g, --global
flag to transform
and transformer
clis to denote the same semantics that npm
uses.
transformer module install paths
Usage - Use Cases
Here are the use cases that transformer should support. Useful to list these out to ensure solutions satisfy these. (It may be the case that the cli should be its own module).
Things to keep in mind:
npm install
(meaning, can list transformer module deps inpackage.json#dependencies
).As a lib, from any node module
require('transformer.<id>')
.package.json
node_modules/
(npm root
)As a lib, from js in the web.
Same as above, using browserify.
From cli, globally, with globally installed modules
node_modules/
(npm -g root
).From cli, globally, with locally installed modules
us-zipcode
installed locallyus-city
from globalFrom cli, locally, with locally installed modules
node_modules/
package.json