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

nccpo

v0.0.1

Published

A tool to further optimize packages built with @zeit/ncc

Downloads

5

Readme

ncc package optimization

nccpo sits on top of the @zeit/ncc project, and adds additional optimization to the generated builds by stripping away bundled package.json dependencies and automatically pack-ing the build.

Following in the steps of zeit's philosophy of zero configuration, there is no configuration needed to run nccpo:

nccpo build ./src/index.ts -o dist [-- pack arguments]

All other commands are passed directly to the @zeit/ncc module, making nccp a full stand-in:

npx nccpo run src/index.ts

Installation

The package can be installed globally or run by npx

yarn add nccpo @zeit/ncc@^0.20.5

Usage

This module provides a simple CLI command, nccpo, that fronts the @zeit/ncc project with a bit of additional build behavior.

If combined with Yarn or npm, it can be run as:

yarn nccpo help
# or
npx nccpo help

It can also be used as part of an npm script:

{
  "scripts": {
    "build": "tsc",
    "predist": "yarn test",
    "dist": "nccpo build src/index.js -o dist",
    "prepublishOnly": "yarn dist"
  },
  "devDependencies": {
    "@camacho/nccp": "latest"
  }
}
yarn format:pkg

CLI

The CLI accepts the @zeit/ncc build arguments:

yarn @camacho/nccp build src/index.ts -o dist

Integrating

Development

The repository comes with several built in tools to help maintain the package. All the scripts are run through yarn.

Building

To create a production ready version of the application, run:

yarn dist

To create a fresh, unbundled build of the application, run:

yarn build

To go into watch mode (which is not necessary for testing):

yarn dev

Docs

Documentation helps lower the barrier of entry and get new users involved. It can also make them feel welcome to the project and more willing to contribute or ask questions.

To keep the documentation up to date, run:

yarn docs

Formatting

To help remove any worries about content consistency, formatting is managed automatically with prettier, and format-package.

These formatters can be run with:

yarn format

Linting

The code linters help catch simple bugs and keep the codebase consistent. They can be run with:

yarn lint

Commit Messages

Commit messages are linted with commitlint to help with consistency and enable semantic-release in the future.

Git Hooks

A series of GitHooks have been setup and are managed through husky and lint-staged. These hooks automate dependency installation, formatting, testing, commit linting, and a host of other behavior.

Scripts

These scripts can be run via yarn or npm run:

| Script | Description | | ---------------- | ---------------------------------------------------------------------------------------------------------------- | | build | transpile TypeScript files in the src directory into JavaScript files in the build directory | | clean | clean build and dist directory | | dev | run ts-node-dev with src/cli/index.ts entrypoint | | dist | package a dist version of the repository (dogfooding) | | docs | update auto-generated-content blocks in Markdown files | | format | format repository code | | format-package | format package.json files using format-package | | format-source | format source content using prettier | | gamut | run the full gamut of checks - reset environment, generate docs, format and lint code, run tests, and build | | lint | lint the application code | | prepublishOnly | build the package before publishing | | prerelease | yarn gamut | | release | semantic-release | | reset | clean dist, build, and node_modules directories | | start | run the compiled application from dist directory | | start-dev | run the application using ncc run | | type-check | check source types |

Note - This repo depends on husky and lint-staged to automatically format code and update documents. If these commands are not run, code changes will most likely fail.