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

licenses-html-generator

v1.1.0

Published

Generates html licenses file from list of sources (git repos or local files)

Downloads

493

Readme

Licenses html generator

npm

Generates an html licenses file from a list of license sources, which can be git repos or local files. For git repos, it makes a shallow clone and automatically gets the license from the readme or license file.

Example sources file

Example generated page

Usage

  1. Install with npm install -g licenses-html-generator

  2. Create a new directory for the script to do its thing in (this is where it will clone any git repos and where the output html file will be)

  3. Create a file called sources.json in the new directory that contains a json array of sources:

[
    {
        "name": "Example 1",
        "uri": "https://github.com/example/example-repo.git"
    },
    {
        "name": "Example 2",
        "uri": "./local-license-text-file.txt"
    }
]
  1. Run licenses-html-generator /path/to/dir/from/step/2. The html file will be located at ./out/licenses.html

Templates

The output can be customized by adding a folder called templates to the directory containing sources.json and adding any of the following files:

head.html - Contents for the head tag

styles.css - CSS that will be inlined. Use .license to style the licenses. This is added in addition to the default styles. To override the default styles use default-styles.css

header.html - Html to go at top of page, above all licenses. Will be contained in a header element.

license-header.html - Html that comes before each license. Put <!--NAME--> where you want the name of the license to go.

license.html - For wrapping the license html. Put <!--LICENSE--> where you want the license html to go.

footer.html - Html for the bottom of the page. Will be contained in a footer element. If you don't want to have "Created with Licenses HTML Generator" at the bottom, create this file.

License

Released under the MIT License.