├── .gitignore ├── Readme.md └── make.js /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea/ 2 | /node_modules/ 3 | npm-debug.log -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | Whole npm 2 | ========= 3 | 4 | Install all npm packages. 5 | 6 | With this package all dependencies are available immediately! It is very convinient to install whole-npm instead of all real dependencies every time! 7 | 8 | It is easy as execute 9 | 10 | npm install ftdebugger/whole-npm 11 | 12 | Try it right now! 13 | -------------------------------------------------------------------------------- /make.js: -------------------------------------------------------------------------------- 1 | var https = require('https'); 2 | var fs = require('fs'); 3 | 4 | var options = { 5 | hostname: 'skimdb.npmjs.com', 6 | port: 443, 7 | path: '/registry/_all_docs' 8 | }; 9 | 10 | var req = https.request(options, function(res) { 11 | var body = ''; 12 | 13 | res.setEncoding('utf8'); 14 | res.on('data', function (chunk) { 15 | body += chunk.toString(); 16 | }); 17 | 18 | res.on('end', function() { 19 | var packageJson = require("./package.json"); 20 | var currentDependencies = packageJson.dependencies; 21 | var json = JSON.parse(body); 22 | 23 | packageJson.dependencies = {}; 24 | 25 | var foundNewDeps = 0; 26 | json.rows.forEach(function(package){ 27 | // Ok, really not whole npm 28 | if (package.id !== 'whole-npm') { 29 | if (!currentDependencies[package.id]) { 30 | foundNewDeps++; 31 | } 32 | 33 | packageJson.dependencies[package.id] = '*'; 34 | } 35 | }); 36 | 37 | console.log('Found', foundNewDeps, 'new deps'); 38 | 39 | fs.writeFileSync("package.json", JSON.stringify(packageJson, null, 2)); 40 | }); 41 | }); 42 | 43 | req.end(); --------------------------------------------------------------------------------