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

commit-spell

v0.0.1

Published

Unites Atom's spellchecker, VSCode's Code Spell Checker dictionaries, custom local and user dictionaries, and words from your repository's commit history to spellcheck your commit messages as you craft them

Downloads

3

Readme

Black Lives Matter! Maintenance status Last commit timestamp Open issues Pull requests Codecov Source license Tree shaking support Compressed package size NPM version Uses Semantic Release!

commit-spell

commit-spell unites Atom's multi-platform spellchecker (bindings for Hunspell, Windows Spell Check API, and NSSpellChecker), VSCode's Code Spell Checker dictionaries, custom local and user dictionaries, and words from your repository's commit history to spellcheck your commit messages as you craft them.

Install

npm install --save-dev commit-spell

Note: you probably don't need to read through this! This information is primarily useful for those attempting to bundle this package or for people who have an opinion on ESM versus CJS.

This is a dual CJS2/ES module package. That means this package exposes both CJS2 and ESM entry points.

Loading this package via require(...) will cause Node and Webpack to use the CJS2 bundle entry point, disable tree shaking in Webpack 4, and lead to larger bundles in Webpack 5. Alternatively, loading this package via import { ... } from ... or import(...) will cause Node to use the ESM entry point in versions that support it, as will Webpack. Using the import syntax is the modern, preferred choice.

For backwards compatibility with Webpack 4 (compat with Webpack 4 is not guaranteed!) and Node versions < 14, package.json retains the module key, which points to the ESM entry point, and the main key, which points to the CJS2 entry point explicitly (using the .js file extension). For Webpack 5 and Node versions >= 14, package.json includes the exports key, which points to both entry points explicitly.

Though package.json includes { "type": "commonjs"}, note that the ESM entry points are ES module (.mjs) files. package.json also includes the sideEffects key, which is false for optimal tree shaking, and the types key, which points to a TypeScript declarations file.

Additionally, this package does not maintain shared state and so does not exhibit the dual package hazard.

Usage

git is required to run commit-spell.

commit-spell can be run by hand—where the current working directory is the root of your repository—or as part of a commit-msg git hook:

npx commit-spell

When run, it looks for a <current working directory>/.git/COMMIT_EDITMSG file and checks its (utf-8) contents for spelling errors. In addition to the platform-specific spellchecker and words in the text-extensions dictionary, a word can be whitelisted by adding it to one of the following:

  • <current working directory>/.spellcheckignore or <user home directory>/.config/_spellcheckignore on a new line
  • <current working directory>/package.json as a key under dependencies, devDependencies, peerDependencies, or scripts
  • <current working directory>/.vscode/settings.json or <user home directory>/.config/Code/User/settings.json as an element of cSpell.words, cSpell.userWords, or cSpell.ignoreWords
  • Any word appearing in the output of git log --format="%B" HEAD~1

Additionally, you can use --help to get help text output, --version to get the current version, --silent to prevent all output, and --show-all to show all potential typos.

Example

This repository uses itself to spellcheck its own commits via husky.

Importing as a Module

This package can be imported and run directly in source without spawning a child process or calling a CLI. This is useful for, for instance, composing multiple yargs-based CLI tools together.

import { configureProgram } from 'commit-spell';

const { program, parse } = configureProgram();
// `program` is a yargs instance
// `parse` is an async function that will (eventually) call program.parse(...)
await parse([]);

Documentation

Further documentation can be found under docs/.

License

FOSSA analysis

Contributing and Support

New issues and pull requests are always welcome and greatly appreciated! 🤩 Just as well, you can star 🌟 this project to let me know you found it useful! ✊🏿 Thank you!

See CONTRIBUTING.md and SUPPORT.md for more information.