Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyze any package.json, not just npm packages #24

Closed
ccoenen opened this issue Apr 25, 2018 · 3 comments
Closed

Analyze any package.json, not just npm packages #24

ccoenen opened this issue Apr 25, 2018 · 3 comments

Comments

@ccoenen
Copy link

ccoenen commented Apr 25, 2018

I'm helping out with a node.js project which is not itself a npm package. I would love to just toss this URL into the seach field and get its dependencies (or, of course, any other packe.json):

https://raw.githubusercontent.com/hackmdio/hackmd/master/package.json

@anvaka
Copy link
Owner

anvaka commented May 12, 2018

I like this suggestion!

I made it work for the basic case, e.g. for this repository: http://npm.anvaka.com/#/view/2d/https%253A%252F%252Fraw.githubusercontent.com%252Fanvaka%252Fnpmgraph.an%252Fmaster%252Fpackage.json

For some reason it doesn't work for https://raw.githubusercontent.com/hackmdio/hackmd/master/package.json . I can look into this later, but the package that builds dependencies graph is here - https://github.com/anvaka/npmgraphbuilder if someone wants to dig deeper - please feel free to!

@ccoenen
Copy link
Author

ccoenen commented Jun 3, 2018

After a bit of fiddling with the graphbuilder, I believe the -ce suffix of 1.1.1-ce is to blame.

If I toss the exact version string into the demo, it works:

diff --git a/demo/index.js b/demo/index.js
index 91cabbf..20b519a 100644
--- a/demo/index.js
+++ b/demo/index.js
@@ -4,7 +4,7 @@ var graphBuilder = require('../')(httpClient);
 var pkgName = process.argv[2] || 'browserify';
 console.log('building dependencies graph for', pkgName);

-graphBuilder.createNpmDependenciesGraph(pkgName, graph).
+graphBuilder.createNpmDependenciesGraph(pkgName, graph, '1.1.1-ce').
   then(function (graph) {
     console.log('Done.');
     console.log('Nodes count: ', graph.getNodesCount());

the -ce is supposed to mean "community edition", but it's not a good idea to put it in that place as it is taken as "prerelease" by semver.

@ccoenen
Copy link
Author

ccoenen commented Oct 10, 2018

It works now, I believe the reason is that the project dropped the -ce suffix.

I'll close this. if this comes up again anywhere, someone can reopen this as a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants