ember-browserify
is a great choice for use in apps, and there is work being done to try to allow Ember CLI to import NPM packages without any extra help at all.
However, if you're trying to make this work in both addons and apps you can take a slightly different approach, which is to manually modify the broccoli build chain to include your Node package.
This is a quick example of how this can be done in an addon's index.js
file:
var path = require('path');
var mergeTrees = require('broccoli-merge-trees');
var Funnel = require('broccoli-funnel');
module.exports = {
name: 'my-addon',
treeForVendor: function(tree) {
var packagePath = path.dirname(require.resolve('node-package'));
var packageTree = new Funnel(this.treeGenerator(packagePath), {
srcDir: '/',
destDir: 'node-package'
});
return mergeTrees([tree, packageTree]);
},
included: function(app) {
this._super.included(app);
if (app.import) {
this.importDependencies(app);
}
},
importDependencies: function(app) {
app.import('vendor/node-package/index.js');
}
};
A similar technique can be used for standard apps. Again, this method will be replaced soon as the Ember CLI team adds support for Node modules, so try to use it sparingly and keep up to date with Ember CLI!