javascript - Getting package description from NPM via browser -
i'm trying write chrome web app read information npm. chrome obeys access-control-allow-origin flags on websites, causing me problems.
while can read following url:
http://registry.npmjs.org/simple-js/-/simple-js-0.1.5.tgz
because has access-control-allow-origin: *
in headers, can't load url:
http://registry.npmjs.org/simple-js
which 1 need find out latest version (and hence find out above url).
any ideas? there url access in order find same data?
note: app read package info npm. don't want precompile npm packages it.
with chrome web apps, can set manifest file ignore same-origin policy. can see document: https://developer.chrome.com/extensions/xhr
that easiest solution can think of. alternatively, may download tgz file , decompress on client, or can create proxy retrieve json file (a web page downloads file , sends client appropriate headers).
Comments
Post a Comment