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

kvikk-fix

v0.0.4

Published

Apply prettier to all TypeScript files in your project

Downloads

3

Readme

kvikk-fix

A CLI tool for applying prettier to all TypeScript files in your project. It automatically reads your tsconfig.json from the current working directory, expands a list from that config file, and rewrites every file in that list. This tool runs in two modes:

  • Rewrite mode, which does what is described above. This is the default mode.
  • Check mode, a dry run which outputs which files would have been rewritten by prettier, but does not actually rewrite. This is enabled by supplying the -l or --list-different flag when invoking. One way to use this mode is to use it in a CI job to prevent unformatted code from being checked in.

Stability

This tool is still in its infancy (version 0.0.x), so command line options may change between patch releases. Use this tool with a locked-down version to avoid drift between releases.

Try it out

If you are using [email protected] or above, you can run the following command instead of kvikk-fix:

npx -p prettier -p typescript -p kvikk-fix kvikk-fix

This lets you reformat the entire codebase without ever having to change any of your project's dependencies. Please do not do this on a codebase that is not under version control! That would irrevocably rewrite everything with no way to undo it.

Installation

Run:

npm install --save-dev kvikk-fix

Make sure the peer dependencies prettier and typescript are fulfilled first, e.g. by having them as dev dependencies in your project. As of writing, kvikk-fix requires at least [email protected] and [email protected].

Errors and Exit Status

Here is a list of exit statuses common across both modes:

  • 0, the operation completed successfully
  • 1, the supplied flag was not recognized
  • 2, there was an error in reading, writing, or resolving the configuration.

The exit status 3 is exclusive to check mode. It occurs when there are files that do not conform to prettier's standards, and would have been rewritten by it.

Configuration

Unlike the vanilla prettier CLI utility, kvikk-fix does not allow configuring formatting options using command line options. Instead, the config file resolution process is used. See the [prettier README] (https://github.com/prettier/prettier/blob/master/README.md#configuration-file) for more details.

Name

The word "kvikk" means "quick" in Norwegian.