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

@dev-build-deploy/reuse-it

v0.4.4

Published

(ReUSE) Copyright and License management library

Downloads

5

Readme

ReuseIt - Copyright and License Management Library

Creates an SPDX 2.3 Software Bill of Materials based on the provided files, per ReUSE Software specification.

⚠️ NOTE ⚠️

ReuseIt (and its owner) are not part of a law firm and, as such, the owner nor the application provide legal advise. Using ReuseIt does not constitute legal advice or create an attorney-client relationship.

ReuseIt is created for the aggregation of Copyright and License information provided by the users in the files stored in their repositories. In the end, the users of ReuseIt are responsible for the correctness of the generated Software Bill of Materials, the associated licenses, and attributions. For that reason, ReuseIt is provided on an "as-is" basis and makes no warranties regarding any information or licenses provided on or through it, and disclaims liability for damages resulting from using the application.

Features

Basic Usage

import { SoftwareBillOfMaterials } from "@dev-build-deploy/reuse-it";

// Create an empty Software Bill of Materials
const sbom = new SoftwareBillOfMaterials("Example Project", "Example Tool v0");

// Add associated (related) files
await sbom.addFile("src/spdx/sbom.ts");

// Show the results
console.log(JSON.stringify(sbom, null, 2))

This will result in an SPDX 2.3 SBoM;

{
  "SPDXID": "SPDXRef-DOCUMENT",
  "spdxVersion": "SPDX-2.3",
  "documentNamespace": "http://spdx.org/spdxdocs/spdx-v2.3-45eae250-b782-46dd-9723-62ec3bed2a7c",
  "dataLicense": "CC0-1.0",
  "relationships": [
    {
      "spdxElementId": "SPDXRef-DOCUMENT",
      "relationshipType": "DESCRIBES",
      "relatedSpdxElement": "SPDXRef-26277ea6651754576f3b48212813e2c9c26e7464"
    }
  ],
  "files": [
    {
      "checksums": [
        {
          "algorithm": "SHA1",
          "checksumValue": "32ac7ea6fbf35e1a03662715a1a345ccc569d05d"
        }
      ],
      "fileContributors": [],
      "fileTypes": [],
      "licenseConcluded": "NOASSERTION",
      "licenseInfoInFiles": [
        "MIT"
      ],
      "attributionTexts": [],
      "fileName": "./src/spdx/sbom.ts",
      "SPDXID": "SPDXRef-26277ea6651754576f3b48212813e2c9c26e7464",
      "copyrightText": "2023 Kevin de Jong <[email protected]>"
    }
  ],
  "name": "Example Project",
  "creationInfo": {
    "comment": "Generated by Example Tool v0",
    "created": "2023-01-01T00:00:00.000Z",
    "creators": [
      "Tool: Example Tool v0"
    ]
  }
}

Basic guidelines

Adding licensing and copyright information to your file

Per the ReUSE Software specification, you can cover your files with the following approaches:

SPDX-FileCopyrightText: 2023 Kevin de Jong <[email protected]>
SPDX-License-Identifier: MIT
  • Adding a .license file next to your (binary) files
  • Using DEP5 allows for specifying copyright and licensing in bulk

Please refer to the Reuse specification for more details.

NOTE: Support for .license files is still under construction

Use SPDX File Tags to enrich your Software Bill of Materials

To enrichen your SPDX 2.3 SBOM, additional File Tags can be used to add additional information to each file. For example:

SPDX-FileCopyrightText: 2023 Kevin de Jong <[email protected]>
SPDX-FileType: DOCUMENTATION
SPDX-License-Identifier: MIT
SPDX-FileLicenseConcluded: MIT
SPDX-FileLicenseComments: This file is original work of the copyright holder, and therefor the license specified in the file is correct.
SPDX-FileComment: This file is part of the public documentation.
SPDX-FileContributor: Kevin de Jong

Ignoring false positive matches

ReuseMe attempts to limit the number of false positive hits by;

  • Only scanning the first 1024 characters of your files
  • Ensure that SPDX- tags are the first words on a line

In case you do run into a false-positive match, you can use the REUSE-IgnoreStart and REUSE-IgnoreEnd tags to ignore snippets.

function foo(bar: string) {
  // REUSE-IgnoreStart
  if (bar.includes(
    "SPDX-FileCopyrightText is important"
  )) {
    console.log("Ru-roh")
  }
  // REUSE-IgnoreEnd
}

Contributing

If you have suggestions for how reuse-it could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the Contributing Guide.

License