Gathering detailed insights and metrics for putout
Gathering detailed insights and metrics for putout
Gathering detailed insights and metrics for putout
Gathering detailed insights and metrics for putout
🐊 Pluggable and configurable JavaScript Linter, code transformer and formatter, drop-in ESLint superpower replacement 💪 with built-in support for js, jsx, typescript, flow, markdown, yaml and json. Write declarative codemods in a simplest possible way 😏
npm install putout
Typescript
Module System
Min. Node Version
Node Version
NPM Version
65.7
Supply Chain
91.2
Quality
92.6
Maintenance
100
Vulnerability
97.9
License
JavaScript (99.09%)
TypeScript (0.65%)
HTML (0.17%)
WebAssembly (0.05%)
CSS (0.02%)
Svelte (0.01%)
Total Downloads
2,405,412
Last Day
3,091
Last Week
13,059
Last Month
56,926
Last Year
759,759
722 Stars
14,749 Commits
40 Forks
10 Watching
46 Branches
24 Contributors
Latest Version
38.0.4
Package Id
putout@38.0.4
Unpacked Size
518.36 kB
Size
113.88 kB
File Count
50
NPM Version
10.9.0
Node Version
22.13.1
Publised On
01 Feb 2025
Cumulative downloads
Total Downloads
Last day
1.2%
3,091
Compared to previous day
Last week
-7.3%
13,059
Compared to previous week
Last month
1.1%
56,926
Compared to previous month
Last year
30.6%
759,759
Compared to previous year
163
Perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away.
(c) Antoine de Saint Exupéry
🐊Putout is a JavaScript Linter, pluggable and configurable code transformer, drop-in ESLint replacement with built-in code printer and ability to fix syntax errors. It has a lot of transformations that keeps your codebase in a clean state, removing any code smell and making code readable according to best practices.
The main target is JavaScript, but:
are also supported. Here is how it looks like:
Check out couple variants of plugins that does the same: linting debugger statement:
1'use strict'; 2 3module.exports.report = () => 'Unexpected "debugger" statement'; 4 5module.exports.replace = () => ({ 6 debugger: '', 7});
Choose wisely, competitors cannot even fix… 🤫
If I have seen further, it is by standing upon the shoulders of giants.
(c) Isaak Newton
API
.API
documented in Handbook
and responsiveness of a team.config
and plugins
support.☝️ 🐊Putout on the other hand can make more drastic code transformations that directly affects your codebase making it a better place to code 💻.
variables
;for-of variables
;typescripts
types;variables
;private fields
;expressions
;variables
;Object.assign()
;replace()
;map
;mapped types
;mapping modifiers
;continue
;operand
;array constructor
;conditions
;type conversion
;functions
;Array.from
;spread
;arguments
;escape
;async
;await
;typeof
;template expressions
;for-of
;array.entries()
;debugger
statement;iife
;process.exit
call;console.log
calls;empty block statements
;empty patterns
;strict mode
directive from esm
;constant conditions
;boolean
from assertion
;boolean
from logical expressions
;duplicates
from TypeScript Union
;unreachable code
;duplicate keys
;typescripts
types;typescripts
interface keys;test.only
to test
calls;test.skip
to test
calls;init
;variable declarations
;nested destructuring
;assignment
;ternary
;logical expressions
;strict mode
directive in commonjs
add it;const
to let
(when needed to avoid TypeError
);apply
to spread
;bitwise
to logical
operator;concat
to flat
;esm
to commonjs
(enabled for *.cjs
);commonjs
to esm
(enabled for *.mjs
);template
with one expression
to string
;equal
to strict equal
;indexOf
to includes
;replace
to replaceAll
;assignment
to arrow function
;forEach
to for...of
;map
to for...of
;reduce
to for...of
;Math.sqrt()
to Math.hypot()
;return await
;Promise.resolve
;Promise.reject
to throw
;reference
;undefined variables
;imports
first;as
type assertions;utility types
;array.at
;filter(Boolean)
;if condition
;await import
;flatMap()
;template literals
;imports
;functions
;npm i putout -D
Usage: putout [options] [path]
Options:
-h, --help display this help and exit
-v, --version output version information and exit
-f, --format [formatter] use a specific output format, the default is: 'progress-bar' locally and 'dump' on CI
-s, --staged add staged files when in git repository
-i, --interactive set lint options using interactive menu
--fix apply fixes of errors to code
--fix-count [count = 10] count of fixes rounds
--rulesdir use additional rules from directory
--transform [replacer] apply Replacer, for example 'var __a = __b -> const __a = __b', read about Replacer https://git.io/JqcMn
--plugins [plugins] a comma-separated list of plugins to use
--enable [rule] enable the rule and save it to '.putout.json' walking up parent directories
--disable [rule] disable the rule and save it to '.putout.json' walking up parent directories
--enable-all enable all found rules and save them to '.putout.json' walking up parent directories
--disable-all disable all found rules (set baseline) and save them to '.putout.json' walking up parent directories
--match [pattern] read '.putout.json' and convert 'rules' to 'match' according to 'pattern'
--flow enable flow
--fresh generate a fresh cache
--no-config avoid reading '.putout.json'
--no-ci disable the CI detection
--no-cache disable the cache
--no-worker disable worker thread
To find errors:
putout lib test
To fix errors:
putout lib test --fix
By default 🐊Putout uses all enabled by default plugins, anyways it can be run with a couple mentioned plugins (split with ","):
1putout lib --plugins remove-debugger,remove-unused-variables
🐊Putout supports next environment variables
:
PUTOUT_FILES
- files that should be processed by putout, divided by ",";PUTOUT_CONFIG_FILE
- path to 🐊Putout config file;ESLINT_CONFIG_FILE
- path to ESLint config file;NO_ESLINT
- do not run ESLint after 🐊Putout;NO_ESLINT_WARNINGS
- do not show ESLint warnings;1PUTOUT_FILES=lib,test putout --fix
To configure create .putout.json
file and override any of default options.
When you need to match paths to rules you can use match
section for this purpose in .putout.json
:
1{ 2 "match": { 3 "server": { 4 "remove-process-exit": true 5 } 6 } 7}
When you need to ignore some routes no metter what, you can use ignore
section in .putout.json
:
1{ 2 "ignore": ["test/fixture"] 3}
🐊Putout supports two types of plugins
, prefix with:
@putout/plugin-
;putout-plugin-
;To use your plugin createnpm
package with keywords putout
, putout-plugin
and add it to .putout.json
.
For example if you need to remove-something
create 🐊Putout plugin with name putout-plugin-remove-something
and it to package.json
:
1{ 2 "plugins": ["remove-something"] 3}
🐊Putout supports codemodes
in the similar to plugins way, just create a directory ~/.putout
and put your plugins there. Here is example: convert-tape-to-supertape and this is examples of work.
All examples works both in ESM and CommonJS.
CommonJS:
1const putout = require('putout');
ESM:
1import {putout} from 'putout';
1import {putout} from 'putout'; 2 3const source = ` 4 const t = 'hello'; 5 const m = t + '!'; 6 console.log(t); 7`; 8 9putout(source, { 10 plugins: ['remove-unused-variables'], 11}); 12 13// returns 14` 15const t = 'hello'; 16console.log(t); 17`;
1import {putoutAsync} from 'putout'; 2 3const source = ` 4 const t = 'hello'; 5 const m = t + '!'; 6 console.log(t); 7`; 8 9await putoutAsync(source, { 10 plugins: ['remove-unused-variables'], 11}); 12 13// returns 14` 15const t = 'hello'; 16console.log(t); 17`;
MIT
No vulnerabilities found.
Reason
30 commit(s) and 4 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
no binaries found in the repo
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no SAST tool detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More@putout/printer
Simplest possible opinionated Babel AST printer for 🐊Putout
@putout/plugin-putout-config
🐊Putout plugin helps to maintain putout config
@putout/plugin-putout
🐊Putout plugin helps with plugins development
@putout/processor-json
🐊Putout processor adds ability to lint json