Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

initial checkin

  • Loading branch information...
commit 8586dcc4628c4b63799deee0d52f063780301bdf 0 parents
@chrismatthieu authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 npmall.rb
21 npmall.rb
@@ -0,0 +1,21 @@
+require 'rubygems'
+require 'json'
+require 'net/http'
+
+class MethodTable # returns JSON hash containing all NPM modules available
+def get_table
+url = "http://registry.npmjs.org"
+url = URI.parse(url)
+method_list = Net::HTTP.get(url)
+end
+end
+
+method_table = MethodTable.new
+table = method_table.get_table
+table = JSON.parse(table)
+
+table.each do |i|
+ puts "nmp install #{i[0]}"
+ # system 'npm install #{i[0]}' rescue nil
+ `npm install #{i[0]}` rescue nil
+end

1 comment on commit 8586dcc

@isaacs

Why not just do npm ls | awk '{print $1}' | xargs npm install?

Please sign in to comment.
Something went wrong with that request. Please try again.