require 'open-uri' require 'zlib' require 'fileutils' require 'json' require 'packr' module Capucine class NPM @@noderoot = 'http://registry.npmjs.org/' def initialise(lib_name) infos = JSON.parse open("#{@@noderoot}#{file['name']}").read version = file['version'] || infos['dist-tags']['lastest'] lib = infos['versions'][version] tarball_url = lib['dist']['tarball'] # tarball = open(tarball_url).read end end end