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

use-license

v0.1.2

Published

Download license via SPDX identifier

Downloads

73

Readme

use-license

NPM Version Coverage Status BMC

Yet another take at a license downloader.

npx use-license

License data is guaranteed to be up to date as license list and text are fetched directly from SPDX.

Usage

To choose a license:

npx use-license

This will show a list of all SPDX licences that are certified by the OSI or the FSF for selection. After selection it'll write the license text into ./LICENSE.

Some licenses have fields to fill out. use-license has not implemented this functionality — the user is expected to fill it out themself.

To skip the prompt:

npx use-license MIT # or any SPDX identifier

This will download the MIT license into the ./LICENSE file.

Full usage

# Show help
npx use-license --help

# List all open source licenses in the SPDX license list
npx use-license --list

# List all licenses in the SPDX license list, including nonfree licenses
# (licenses not certified by the OSI or FSF)
npx use-license --list --all

# Select a license to open in browser
npx use-license --open
# Open license whose id is <ID> in browser
npx use-license --open "<ID>"
# --open is just a boolean flag
npx use-license "<ID>" --open

# Select a license to download
npx use-license
# Select a license to download; also show nonfree licenses as candidates
npx use-license --all
# Download the license whose id is <ID>
npx use-license "<ID>"
# Always overwrite ./LICENSE instead of asking when it exists
npx use-license --force

Thanks

Prior art

  • npm:license by Ovyerus
    • Has some extra stuff around filling out license templates.
      • use-license instead just throws the license text into ./LICENSE, and you are always expected to fill it out manually.
    • Seems like it does extra text wrapping
    • Relies on a fork of spdx-license-list, both of which require periodic updates
      • use-license fetches directly from spdx/license-list-data, therefore needs internet access but will always be up to date