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

repo-check

v1.35.0

Published

Repo cleaning made easy

Downloads

715

Readme

Repo Checker

Project license Code Climate maintainability npm version npm monthly downloads

Package Quality Publish size Install size

logo

Usage

Choose your favorite method :

  1. Via npx : npx repo-check
  2. Via npm locally : npm install repo-check then run npx repo-check or use it in your package.json scripts
  3. Via local installation : clone this repository, cd into the folder and use pnpm start, pnpm start -- --target=../my-other-project for single run or pnpm dev, pnpm dev -- --target=../my-other-project

Pro tip : init repo-checker before fixing files.

Parameters

target

--target=path/to/folder tells repo-checker which directory it should scan. If no target is specified, repo-checker will scan current directory. Target can be a relative or absolute path, can contain one project or more.

fix

--fix kindly ask repo-checker to try to create missing files or update problematic ones. For example, repo-checker will check for a README.md, if it does not exists, the file will be created and filled with data accordingly to the README.md template (templates/README.md). Repo-checker will try to grab as much info as possible from the project folder to create this file. If it's not enough, you'll be prompt to init. If you want to fix already existing files, use --force to overwrite it.

init

--init ask repo-checker to initialize a data config file in the current directory. If file already exists, use --force to overwrite it.

quiet

--quiet repo-checker will works silently without output-ing to console, will only output to log file.

Todo

  • [ ] if website : check static folder : should have "_headers" & "favicon.ico" and "manifest.json" files inside
  • [ ] compute build/dist/folder/public size for maxSize compliance
  • [ ] check rel="noopener" or rel="noreferrer" to any <a external links to improve performance and prevent security vulnerabilities
  • [ ] check width and height attributes to any <img or <video to ensures that the browser can allocate the correct amount of space in the document
  • [ ] add nbFixes to the report
  • [ ] check last tag, suggest to tag if last one is old
  • [ ] extends unit tests to src/files (remove c8 ignore start temporary exclusions)
  • [ ] prepare a json schema for .repo-checker.json
  • [ ] try to avoid using class in this project and remove eslint-disable-next-line no-restricted-syntax

Benchmarks

Each bench result is from hyperfine --runs 20 --warmup 3 'COMMAND_TO_BENCH'.

| command alias | date | main lib targeted | delay | node | os | comment | | ------------- | ---------- | ----------------- | ------ | ----- | ----- | ------- | | vitest-v8 | 2023-07-17 | npx & vitest & v8 | 2,16 s | 18.16 | Linux | | | vitest | 2023-07-17 | npx & vitest 0.33 | 1,97 s | 18.16 | Linux | | | esbuild | 2023-07-17 | esbuild 0.18 | 12 ms | 18.16 | Linux | | | repo-check | 2023-07-17 | repo-checker 1.33 | 55 ms | 18.16 | Linux | | | repo-check | 2023-06-19 | repo-checker 1.31 | 60 ms | 18.16 | Linux | | | esbuild | 2023-06-19 | esbuild 0.18 | 12 ms | 18.16 | Linux | | | tsc-no-emit | 2023-06-19 | typescript 5.1 | 760 ms | 18.16 | Linux | | | eslint | 2023-06-19 | eslint 8.43 | 7,4 s | 18.16 | Linux | | | vitest-v8 | 2023-06-19 | npx & vitest & v8 | 1,9 s | 18.16 | Linux | | | vitest | 2023-06-19 | npx & vitest 0.32 | 1,8 s | 18.16 | Linux | |

Command aliases :

  • repo-check : node dist/repo-check.min.cjs
  • repo-check-no-out : node dist/repo-check.min.cjs --quiet --no-report
  • esbuild : node_modules/.bin/esbuild src/index.ts --target=esnext --bundle --platform=node --minify --outfile=dist/repo-check.min.cjs
  • ts-run : node node_modules/typescript-run/src/index.js src
  • tsc-no-emit : node node_modules/typescript/bin/tsc --noEmit
  • npx-tsc-no-emit : npx tsc --noEmit
  • eslint : node node_modules/eslint/bin/eslint --fix --ignore-path .gitignore --ext .js,.ts .
  • eslint-ts-src-only : node node_modules/eslint/bin/eslint src/ --ext .ts
  • uvu : node node_modules/uvu/bin -r tsm tests
  • c8-uvu : node node_modules/c8/bin/c8 node_modules/uvu/bin -r tsm tests
  • vitest : npx vitest --run
  • vitest-c8 : npx vitest --run --coverage
  • vitest-v8 : npx vitest --run --coverage

Old method

Each task is run 3 times via time npm run <task> to get the average execution time in seconds.

| task | lib | seconds | comment | | ---------- | ------------ | ---------- | -------------------------------------------------- | | build | tsup | 1 | 0 config, 1 dep only, super fast | | build | rollup | 2,7 | lots of deps (plugins) & config to do the same job | | build | esbuild | 0,2 | amazing 👍 | | check | repo-checker | 3,2 (2019) | can surely be reduced ^^ | | check | repo-checker | 0,8 (2021) | | | lint | xo | 2,7 | | | lint | eslint | 3,5 | | | test | ava | 9 | | | test | mocha | 7,4 | a bit faster, same amount of setup | | test | uvu | 1,2 | amazing 👍 | | test + cov | ava + c8 | 16 | 7 seconds for c8 coverage ? wtf | | test + cov | mocha + c8 | 12 | 7 seconds for c8 coverage ? wtf | | test + cov | mocha + nyc | 9,6 | 2 seconds for coverage seems more reasonable | | test + cov | uvu + c8 | 1,6 | amazing 👍 |

Thanks

  • Arg : un-opinionated, no-frills CLI argument parser
  • Dependency-cruiser : handy tool to validate and visualize dependencies
  • Esbuild : an extremely fast JavaScript bundler and minifier
  • Eslint : super tool to find & fix problems
  • Github : for all their great work year after year, pushing OSS forward
  • Repo-checker : eslint cover /src code and this tool the rest ^^
  • Shields.io : for the nice badges on top of this readme
  • Shuutils : collection of pure JS utils
  • V8 : simple & effective cli for code coverage
  • Vitest : super fast vite-native testing framework
  • Watchlist : recursively watch a list of directories & run a command on any file system