Meteor Package Loader
IMPORTANT - THIS HAS BEEN RENAMED IN NPM TO:
Manages file paths for Meteor packages.
Provides sprockets style loading of files for a Meteor package.
Install globally so you can use the command line from any folder.
npm install -g meteor-package-loader
This module assumes you are structuring your package folders like this:
/my-package /client /server /shared /images
To see the available commands, from within your package folder:
$ package --help
To create a fresh
package.js file with all the correct
$ cd my-package $ package create 'My Package'
To update an existing
$ cd my-package $ package update
package.js file will contain the
api.add_files listing for your package taking into account any
sprokets style comment directives you may have within any of the files.
And to update your app's entire set of packages:
$ cd my-app/packages $ package update-all
update-all will not effect any packages that have been sym-linked into your app.
The default load order is deepest to shallowest. Use the comment directives to override this ordering:
require require_directory (shallow) require_tree (deep)
#= require file.coffee #= require_tree ../dir/foo #= require_directory ../dir/foo //= require file.js //= require_tree ../dir/foo //= require_directory ../dir/foo
Files containing the
base directive are ordered first, shallowest to deepest. This is a
reversal of the above rules and is useful for the common pattern of having base classes
declared in parent folders, under which folders contianing the files of deriving classes reside.
#= base //= base
To exclude a file:
Images can be placed anywhere within the folder structure, and they are only added
client. By convention, images are typically stored under:
Testing from the Command Line
$ package --help
For example, from the command line:
$ package directory ./test/simple/client $ package tree ./test/simple $ package tree ./test/directives $ package file ./test/simple/client/child/grand_child/grand_child.coffee $ package file ./test/directives/client/child/grand_child/grand_child.coffee
main will be ordered last, deepest to shallowest.
The execution domain (
shared) is whatever the closest
where name folder is.
For example, you could override the
shared folder, declaring some
client-only files within it like this:
/shared foo.js /client css.styl template.html
Use the same
shared folder structure within a
to have the test files output within the package's
Package.on_test declaration block.
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.