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

readinglist-js

v2.0.0-alpha.5

Published

A static site generator for your reading list

Downloads

6

Readme

readinglist-js

A static site generator for your reading list

Installation

$ npm add readinglist-js

Usage

To generate your reading list website, you'll need a JSON book.json file. To display an avatar image in the rendered static site, you'll also need to provide an avatar.png file, which should live in the same directory as the generated output.

The Book file

The book file is a JSON file with two keys: a meta key, containing an object with configuration options, and a books key, containing an array of JSON objects. The structure should look like this:

{
  "meta": {
    ...
  },
  "books": [
    ...
  ]
}

The meta Object

The structure of the meta object looks like this:

| Key | Value | | --------- | --------------------------------------------------------- | | name | Your name. Displayed in the header of the generated site. | | email | (Currently unused) Your email address. | | website | (Currently unused) Your website. |

All of the values are required.

JSON Feed Output

You can optionally have the generator also output a JSON Feed file by adding a feed key to the meta configuation. The feed object looks like this:

| Key | Value | | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | title | A title for your feed. May be used by feed readers when displaying your feed. See the JSON Feed spec for more information. | | url | The URL to your hosted JSON Feed output. Because this is used by feed readers for discovery, it must be a fully-qualified URL, and readinglist.js can't predict where you'll host the file, you have to provide it yourself. | | avatarUrl | (Optional) The URL to an icon that represents your feed. This URL is used by feed readers to display your feed, and must be a fully-qualified URL. See the JSON Feed spec for more information. |

The book object

The structure of the book object looks like this:

| Key | Type | Value | | ------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------- | | title | string | The title of the book | | author | string | The author of the book | | year | int | The year you read the book (not the year it was published). If year is set, current must not be set. | | current | boolean | Set current to true to mark a book you're currently reading. If current is set, year must not be set. | | link | string | (Optional) A link to the book's website or Amazon page. If provided, the book's title will be a link to this URL in the output. | | recommended | boolean | (Optional) If set to true or false, will mark a book as recommended (or not) in the output template. Ignored otherwise. | | finished | boolean | (Optional) If set to false, marks the book as "Did not Finish" in the output template. Ignored otherwise. |

Running the generator

To generate your site, run the following command:

npx reading-list -b <path to your books.json file> -o <path to your output directory>

Sample output

See reading.joshtompkins.com for a sample site running the default theme.

Development

| Useful yarn Commands | Purpose | | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | install | Installs local dependencies. | | test | Runs local tests. | | sample | Do a test run against the sample books file in the test directory, for local testing. | | link | Prepares this package to be installed locally for inclusion in other projects. In the other project, run link readinglist-js to install. | | global add $PWD | Installs this package globally to your system, allowing you to test the CLI. Note that the contents of the repo are not watched, so if you make changes, you'll need to run this command again. | | publish | Push the latest version of the package to the global NPM repository. You'll need credentials to do this. This command creates local git tags to mark the release version; don't forget to push these to the remote origin. |

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jtompkins/readinglist.js.