awesome-npm

repository·main·Indexed 26 days ago

https://github.com/sindresorhus/awesome-npm

A curated list of high-quality npm resources, tools, packages, and articles. It includes directories for package search engines, registry managers, publishing automation tools, and best practices covering module design, version management, and workflow optimization.

Tokens
1.3K
Snippets
3
Records
10
Agent score
39%

What's inside awesome-npm

  1. Learn npm best practices and concepts via articles

    main

    The repository provides a curated list of articles to help developers master npm. Key topics include:

    • Module Design: Writing small, focused modules and understanding the Unix philosophy in Node.js.
    • Version Management: Deep dives into Semver (Semantic Versioning), including tilde (~) and caret (^) usage.
    • Workflow & Automation: Using npm run for task automation, using npm as a build tool, and why npm scripts are useful.
    • Package Optimization: Techniques for optimizing the footprint of an npm package.
    • Environment Setup: How to install npm packages globally without sudo on macOS and Linux, and how to perform offline installations.
  2. Install packages without saving to package.json

    main

    By default, npm adds installed packages to the dependencies field. To prevent this, use the --no-save flag. To add a package specifically to devDependencies, use --save-dev or -D.

    $ npm install --save-dev ava
  3. Configure shell aliases for npm

    main

    You can speed up common npm tasks by adding aliases to your .zshrc or .bashrc file:

    alias ni='npm install'
    alias nid='npm install --save-dev'
    alias nig='npm install --global'
    alias nt='npm test'
    alias nit='npm install && npm test'
    alias nk='npm link'
    alias nr='npm run'
    alias ns='npm start'
    alias nf='npm cache clean && rm -rf node_modules && npm install'
    alias nlg='npm list --global --depth=0'
  4. Use utility packages for npm dependency and configuration management

    main

    A variety of packages to assist with local development and dependency maintenance:

    Dependency Management

    • Checking & Updating: david (check outdated dependencies), npm-check (interactive update/check), npm-upgrade (interactive update), and luna (dependency management app).
    • Lockfiles & Constraints: npm-shrinkwrap (shrinkwrap tool), synp (convert between yarn.lock and package-lock.json), and lockfile-lint (security linting for lockfiles).
    • Engine Management: engine-deps (manage Node.js version-specific dependencies).

    Configuration & Filesystem

    • Locating Files: package-up and read-package-up (find/read the closest package.json), and package-config (get namespaced config from package.json).
    • Editing: npe (CLI for inspecting/editing package.json).

    Execution & Workflow

    • Scripting: npm-run-all (run scripts in parallel/serial), redrun (expand scripts for speed), and ntl (interactive CLI for npm tasks).
    • Environment: npm-run-path (run local binaries like global ones) and onchange (watch files to run commands).
  5. Manage npm publishing and registry operations

    main

    Tools for automating and managing the lifecycle of npm packages:

    Publishing Automation

    • Improved Publishing: np (better npm publish), publish-please (safe publishing), and npm-release (easy releases).
    • Automated Releases: release-it (automates Git/npm releases and changelogs) and semantic-release (fully automated publishing).
    • Inspection: pkgfiles (list files to be published).

    Registry & Package Management

    • Registry Management: nrm (registry manager), verdaccio (private proxy registry), cloudsmith (managed SaaS registry), and npm-register (setup/maintain registry/proxy).
    • Package Metadata & Info: npm-name (check availability), package-json (get package.json), latest-version (get latest version), npm-user (get user info), and npm-email (get user email).
    • Discovery: npm-keyword (search by keyword) and dpn (get dependents).
  6. Compare npm package clients

    main

    While npm is the official client, other package managers are available for dependency management:

    • npm: The official client bundled with Node.js.
    • yarn: Fast, reliable, and secure dependency management.
    • pnpm: Fast, disk space efficient package manager.
  7. Discover npm tools for web, browser, and CLI

    main

    A collection of tools to enhance your npm workflow:

    Web Tools

    • Search & Discovery: npms (quality-based search), Libraries.io (discovery), moiva (comparison), and npmx.dev (registry viewer).
    • Analysis & Stats: npm-stat (charts), npmgraph (dependency visualization), npm trends (download comparison), and npm-top (top downloads).
    • Utilities: NodeICO (badges), npm semver calculator (version matching), and ghub.io (GitHub redirects).

    Browser Extensions

    • GitHub Integration: Octo-Linker (navigate packages), npm-hub (explore dependencies), and github-npm-stats (view download stats on GitHub).
    • Search: npm-search-update (search and monitor changes).

    CLI Tools

    • Productivity: zsh-better-npm-completion (ZSH completion) and npkill (find and remove heavy node_modules folders).
  8. Use npm command aliases

    main

    npm provides several built-in shorthand aliases for common commands:

    • npm inpm install
    • npm i -Dnpm install --save-dev
    • npm tnpm test
    • npm itnpm install && npm test
    • npm rnpm uninstall
    • npm unnpm uninstall
    • npm upnpm update