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

typehole

v1.7.0

Published

Turn runtime types into static typescript types automatically

Downloads

1,463

Readme

Typehole runtime

A runtime library for Typehole.


Template: TypeScript Module CI codecov

This is a clonable template repository for authoring a npm module with TypeScript. Out of the box, it:

  • Provides minimally-viable tsconfig.json settings
  • Scaffolds a silly arithmetic module (src/index.ts)
  • Scaffolds test suites for full test coverage (test/index.ts)
  • Scaffolds a GitHub Action for Code Integration (CI) that:
    • checks if compilation is successful
    • runs the test suite(s)
    • reports test coverage
  • Generates type definitions (types/*.d.ts)
  • Generates multiple distribution formats:
    • ES Module (dist/index.mjs)
    • CommonJS (dist/index.js)
    • UMD (dist/index.min.js)

All configuration is accessible via the rollup.config.js and a few package.json keys:

  • name — the name of your module
  • main — the destination file for your CommonJS build
  • module — the destination file for your ESM build (optional but recommended)
  • unpkg — the destination file for your UMD build (optional for unpkg.com)
  • umd:name — the UMD global name for your module (optional)

Setup

  1. Clone this template
  2. Replace all instances of TODO within the license and package.json files
  3. Create CodeCov account (free for OSS)
  4. Copy the provided CodeCov token as the CODECOV_TOKEN repository secret (for CI reporting)
  5. Replace src/index.ts and test/index.ts with your own code! 🎉

Commands

build

Builds your module for distribution in multiple formats (ESM, CommonJS, and UMD).

$ npm run build

test

Runs your test suite(s) (/tests/**) against your source code (/src/**).Doing so allows for accurate code coverage.

Note: Coverage is only collected and reported through the "CI" Github Action (.github/workflows/ci.yml).

$ npm test

Publishing

Important: Please finish Setup before continuing!

Once all TODO notes have been updated & your new module is ready to be shared, all that's left to do is decide its new version — AKA, do the changes consitute a patch, minor, or major release?

Once decided, you can run the following:

$ npm version <patch|minor|major> && git push origin master --tags && npm publish
# Example:
# npm version patch && git push origin master --tags && npm publish

This command sequence will:

  • version your module, updating the package.json "version"
  • create and push a git tag (matching the new version) to your repository
  • build your module (via the prepublishOnly script)
  • publish the module to the npm registry

License

MIT © Luke Edwards