Asset manager for lazy people (think homebrew for assets). Somewhat defunct unless someone wants to maintain it, otherwise
I recommend component, a more robust successor.
Installation
$ npm install -g asset
Usage
Usage: asset [command] [options]
Commands:
install <name ...> installs the given asset <name ...>
search [query] search available assets with optional [query]
info <name ...> display verbose information for the given asset <name ...>
none install dependencies from ./assets.json
Options:
-c, --compress compress assets
-o, --out <dir> output directory defaulting to ./public
-V, --version output program version
-h, --help display help information
Alternatively passing a directory name containing "/" will work as well, since asset knows this is not an asset, and becomes equivalent to --out <dir>:
$ asset raphael jquery public/javascripts
Dependency Resolution
Asset currently supports extremely basic dependency mapping, for example below is the output of installing g.pie, which depends on g.raphael, which in turn depends on raphael itself.
By adding ./assets.json you can store application dependencies, and install them quickly and easily with a single command asset. For example this file may contain one or more deps:
By default options must be passed via the CLI, however asset will also check the ./.asset and ~/.asset JSON configuration files, so for example a project may set { "out": "public/javascripts" } if we are mainly working with javascript, however the CLI options will always take precedence.
The Repository
By default the repo bundled with asset is used, however the ~/.assets configuration file is checked first. Perhaps down the road if/when asset becomes more flexible a repo will be hosted, for now simply fork the project edit ./assets.json, and send a pull request.
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.
请发表评论