main-npm-files
Searches for static files in npm packages
Last updated 2 years ago by kaisermann .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install main-npm-files 
SYNC missed versions from official npm registry.

npm-main-files

Front-end users of npm instead of bower deserve some of that automagic resource exploring love too. Excuse my bad documenting, I don't feel like doing it atm.

Look for resources in npm modules, like retrieving all css files to include in your automatic build process or something, pretty neato right.

Instructions

Some instructions because why not. It looks for all files in the files array and main file of a package.json, while also applying a glob. Here is a code example that finds all js files, you can figure it out:

var mainNpmFiles = require('main-npm-files');

mainNpmFiles('**/*.js');

See, that was easy. Missed anything ? Check the source, it's a fairly small file :)

Here are some options you can send along:

  • nodeModules - Location of your modules, defaults to ./node_modules;
  • pkgJson - Location of your package.json, defaults to ./package.json;
  • onlySpecified - Decides if you only want to retrieve the files specified by the package.json or just all files from the package, ah yeah both still have the glob applied of course, defaults to true;
  • onlyMain - If true, it will search only for the main and style while ignoring the files property, defaults to false.

License

MIT License

Copyright (c) 2016 Lorenzo Vuur lorenzo@vuur.me

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.

Current Tags

  • 1.3.0                                ...           latest (2 years ago)

4 Versions

  • 1.3.0                                ...           2 years ago
  • 1.2.1                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (1)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |