Make a directory called packages/
parallel to your .meteor/
directory. You can create a package that exports a single object/function. On the command line, use meteor create --package <yourpackagename>
and meteor add <yourpackagename>
You can edit the js file to add a namespace.
MyNamespace = {};
MyNamespace.myFunction = function () { };
Then, in the package.js, simply export that namespace.
api.export('MyNamespace');
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…