npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

semantic-dependencies

v0.1.2

Published

Convert npm dependencies to RDF.

Downloads

3

Readme

Semantic Dependencies

npm version

This tool converts the node_modules dependencies of an npm project to RDF. Currently this is done by parsing the output of the npm ls command, while in the future we also want to be able to simply parse a given node_modules folder.

Note that this is not the same as the dependencies that can be found in a package.json file! The output will contain the actually installed versions, not the semantic ranges.

Sample output when this is executed on its own folder:

@prefix doap: <http://usefulinc.com/ns/doap#>.
@prefix npm: <https://linkedsoftwaredependencies.org/vocabularies/npm#>.
@prefix doc: <https://www.w3.org/2000/10/swap/pim/doc#>.

<#software> npm:engine <https://linkedsoftwaredependencies.org/engines/node/v6.5.0>, <https://linkedsoftwaredependencies.org/bundles/npm/3.10.3>;
    doap:name "node-dependency-parser";
    doap:revision "0.1.1".
<https://linkedsoftwaredependencies.org/bundles/npm/minimist/1.2.0> doap:revision "1.2.0";
    doap:name "minimist".
<#software> doc:dependsOn <https://linkedsoftwaredependencies.org/bundles/npm/minimist/1.2.0>.
<https://linkedsoftwaredependencies.org/bundles/npm/minimist/1.2.0> doap:file-release <https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz>.
<https://linkedsoftwaredependencies.org/bundles/npm/n3/0.10.0> doap:revision "0.10.0";
    doap:name "n3".
<#software> doc:dependsOn <https://linkedsoftwaredependencies.org/bundles/npm/n3/0.10.0>.
<https://linkedsoftwaredependencies.org/bundles/npm/n3/0.10.0> doap:file-release <https://registry.npmjs.org/n3/-/n3-0.10.0.tgz>.
<https://linkedsoftwaredependencies.org/bundles/npm/valid-url/1.0.9> doap:revision "1.0.9";
    doap:name "valid-url".
<#software> doc:dependsOn <https://linkedsoftwaredependencies.org/bundles/npm/valid-url/1.0.9>.
<https://linkedsoftwaredependencies.org/bundles/npm/valid-url/1.0.9> doap:file-release <https://registry.npmjs.org/valid-url/-/valid-url-1.0.9.tgz>.

This output shows the packages that were installed for this package when this was executed.

Install

This package can be installed via npm.

$ npm install -g semantic-dependencies

Usage

semantic-dependencies [-r root] [-f format] FOLDER
  -r root   : URI to use for the root module.
  -f format : Output format, see below for a full list of supported formats
format: text/turtle, application/n-triples, etc. (all those supported by N3.js)

FOLDER needs to be the root folder of the project. -r is for changing the root URI that needs to be used for this project. The default is #software.

License

This software is written by Joachim Van Herwegen.

This code is released under the MIT license.