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

min2phase

v0.0.1

Published

Template for interacting with cubing JS libraries.

Downloads

5

Readme

lib-template

Lots of boilerplate for a library maintained using Typescript + Webpack.

Usage

git clone https://github.com/cubing/lib-template.js lib-template
cd lib-template

# Make sure you have `node` and `yarn` installed before running this:
yarn install

# Run tests
# (This runs `make dist` under the hood.)
make test

# Use the built library in the browser directly
make dist
open test/html/index.html

To build the output file continuously while working on input files, run make dev.

Layout

Source files are in src. They are compiled into dist/lib-template.js using Webpack.

dist will also contain an additional .d.ts TypeScript definition file for each source file, as well as a lib-template.js.map source map for debugging.

Tests are written in test/test.ts. Run make test to run them.

Some notes:

  • It should be possible to decipher the meaning of every part of this project using comments, code search, and Google. Feel free to ask a question by filing an issue if you are wondering why something is/isn't structured in a particular way.
  • For a larger project based on this template, see alg.js.
  • dist/lib-template.js is a UMD module. That roughly means it can be used in the browser directly as well as in node. To set the name use by the library as a UMD module, set package.jsonumdName.
  • This module is set up for building a library, but can be adapted for commandline tools. You can also run node dist/lib-template.js directly.
  • The output file name (lib-template.js) is taken from package.jsonmain, but can be configured directly in webpack-config.json if needed.
  • This library can be used in other projects like this project itself uses alg. You can either:
    • Publish to npm.
    • Include this project as a node_modules folder in another project.
    • Run yarn link in this checkout and then yarn link lib-template to automatically symlink this project into another project's node_modules folder.
  • TypeScript has some nice autocompletion support in many editors. Make sure to install it!
  • This project has a .travis.yml file you can use to automatically test every commit you push to GitHub (with make test), using Travis CI. If you want this, you'll need to log into Travis CI and set it up for the repo. See this page for an example.
  • Yes, node_modules is expected to contain over 10,000 files. That's apparently how modern JS development is done these days. 🤷‍♀️

Release Process

  1. Update versions for dependencies in package.json if needed
  • Then run yarn install to update that dependency in yarn.lock.
  1. Update version in package.json.
  2. git commit with a summary of user-facing changes.
  3. git tag [version]
  4. git push
  5. npm publish
  • This template has a prepublishOnly script that runs make dist. Make sure that make dist will produce a production build from any state of the project.
  • Or yarn publish once https://github.com/yarnpkg/yarn/issues/4904 is fixed.