Gathering detailed insights and metrics for @putout/plugin-filesystem
Gathering detailed insights and metrics for @putout/plugin-filesystem
Gathering detailed insights and metrics for @putout/plugin-filesystem
Gathering detailed insights and metrics for @putout/plugin-filesystem
🐊 Pluggable and configurable JavaScript Linter, code transformer and formatter, drop-in ESLint superpower replacement 💪 with built-in support for js, jsx, typescript, markdown, yaml and json. Write declarative codemods in a simplest possible way 😏
npm install @putout/plugin-filesystem
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (99%)
TypeScript (0.62%)
WebAssembly (0.19%)
HTML (0.16%)
CSS (0.02%)
Svelte (0.01%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
757 Stars
16,380 Commits
43 Forks
9 Watchers
46 Branches
24 Contributors
Updated on Jul 15, 2025
Latest Version
11.0.1
Package Id
@putout/plugin-filesystem@11.0.1
Unpacked Size
36.81 kB
Size
9.17 kB
File Count
27
NPM Version
11.1.0
Node Version
24.1.0
Published on
May 31, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
🐊Putout plugin helps to lint filesystem.
npm i @putout/plugin-filesystem -D
1{ 2 "rules": { 3 "filesystem/remove-empty-directory": "on", 4 "filesystem/remove-travis-yml-file": "on", 5 "filesystem/remove-vim-swap-file": "on", 6 "filesystem/remove-nyc-output-files": "on", 7 "filesystem/bundle": "off", 8 "filesystem/read-all-files": ["off", { 9 "mask": "*" 10 }], 11 "filesystem/write-all-files": "off", 12 "filesystem/rename-file": "off", 13 "filesystem/remove-files": "off", 14 "filesystem/rename-spec-to-test": "off", 15 "filesystem/rename-test-to-spec": "off", 16 "filesystem/rename-referenced-file": "off", 17 "filesystem/move-referenced-file": "off", 18 "filesystem/convert-simple-filesystem-to-filesystem": "off", 19 "filesystem/replace-cwd": ["off", { 20 "from": "/home/coderaiser/putout", 21 "to": "/" 22 }], 23 "filesystem/convert-json-to-js": ["off", { 24 "filename": "package.json" 25 }], 26 "filesystem/convert-js-to-json": ["off", { 27 "filename": "package.js" 28 }] 29 } 30}
Checkout in 🐊Putout Editor.
Update .putout.json
to enable rule:
1{ 2 "rules": { 3 "filesystem/rename-file": ["on", { 4 "from": "README.md", 5 "to": "readme.md" 6 }] 7 } 8}
It will make next modifications to filesystem:
1-README.md 2+readme.md
For more sophisticated example, use mask
:
1{ 2 "rules": { 3 "filesystem/rename-file": ["on", { 4 "mask": "*.test.*", 5 "from": "test", 6 "to": "spec" 7 }] 8 } 9}
It will rename 'test' to 'spec' in *.test.*
files:
1-index.test.js 2+index.spec.js
Checkout in 🐊Putout Editor.
1/ 2-|-- hello/ 3-| `-- abc/ 4-| `-- def/
Checkout in 🐊Putout Editor.
1-.nyc_output
Checkout in 🐊Putout Editor.
1-.travis.yml
Checkout in 🐊Putout Editor.
1-readme.md.swap
Update .putout.json
to enable rule:
1{ 2 "rules": { 3 "filesystem/remove-files": ["on", { 4 "names": ["coverage"] 5 }] 6 } 7}
It will make next modifications to filesystem:
1 / 2 |-- test/ 3 | `-- hello.spec.js 4-|-- coverage/ 5 `-- lib/ 6 `-- hello.js
Checkout in 🐊Putout Editor.
1-index.spec.js 2+index.test.js
Checkout in 🐊Putout Editor.
1-index.test.js 2+index.spec.js
Update .putout.json
to enable rule:
1{ 2 "rules": { 3 "filesystem/rename-referenced-file": ["on", { 4 "from": "hello.js", 5 "to": "world.js" 6 }] 7 } 8}
Checkout in 🐊Putout Editor.
Before:
1// hello.spec.js 2import hello from './hello.js';
1// hello.js 2export const hello = 'world';
After:
1-hello.js 2+world.js
1// hello.spec.js 2import hello from './world.js';
1// world.js 2export const hello = 'world';
Update .putout.json
to enable rule:
1{ 2 "rules": { 3 "filesystem/move-referenced-file": ["on", { 4 "name": "hello.js", 5 "directory": "lib" 6 }] 7 } 8}
Checkout in 🐊Putout Editor.
Before:
/
|-- test/
| `-- hello.spec.js
|-- src/
| `-- hello.js
`-- lib/
1// test/hello.spec.js 2import hello from '../src/hello.js';
1// src/hello.js 2export const hello = 'world';
After:
/
|-- test/
| `-- hello.spec.js
|-- src/
`-- lib/
`-- hello.js
1-src/hello.js 2+lib/hello.js
1// test/hello.spec.js 2import hello from '../lib/hello.js';
1// lib/hello.js 2export const hello = 'world';
Checkout in 🐊Putout Editor.
1__putout_processor_filesystem([ 2 '/', 3 '/hello.txt', 4 [ 5 '/world.txt', 6 'hello world', 7 ], 8 '/abc/', 9]);
1__putout_processor_filesystem({
2 type: 'directory',
3 filename: '/',
4 files: [{
5 type: 'file',
6 filename: '/hello.txt',
7 }, {
8 type: 'file',
9 filename: '/world.txt',
10 content: 'hello world',
11 }, {
12 type: 'directory',
13 filename: '/abc',
14 files: [],
15 }],
16});
Checkout in 🐊Putout Editor.
1__putout_processor_filesystem({
2 type: 'directory',
3 filename: '/',
4 files: [{
5 type: 'file',
6 filename: '/hello.txt',
7 }, {
8 type: 'file',
9 filename: '/world.txt',
10 content: 'hello world',
11 }, {
12 type: 'directory',
13 filename: '/abc',
14 files: [],
15 }],
16});
1__putout_processor_filesystem([ 2 '/', 3 '/hello.txt', 4 [ 5 '/world.txt', 6 'hello world', 7 ], 8 '/abc/', 9]);
Bundle and minify css
files.
1{ 2 "rules": { 3 "filesystem/bundle": ["on", { 4 "groups": [ 5 ["__:columns/__", [ 6 "name-size-date.css", 7 "name-size.css" 8 ]], 9 ["main.css", [ 10 "hello.css", 11 "world.css" 12 ]], 13 "1:1" 14 ] 15 }] 16 } 17}
Checkout in 🐊Putout Editor.
Before:
/
|-- css/
| `-- hello.css
| `-- world.css
After:
/
|-- css/
| `-- hello.css
| `-- world.css
|-- dist/
| `-- main.css
Just minify styles:
1{ 2 "rules": { 3 "filesystem/bundle": ["on", { 4 "groups": ["1:1"] 5 }] 6 } 7}
Before:
/
|-- css/
| `-- hello.css
| `-- world.css
After:
/
|-- css/
| `-- hello.css
| `-- world.css
|-- dist/
| `-- hello.css
| `-- world.css
Create subdirectory:
1{ 2 "rules": { 3 "filesystem/bundle": ["on", { 4 "groups": [ 5 ["__:columns/__", [ 6 "name-size-date.css", 7 "name-size.css" 8 ]] 9 ] 10 }] 11 } 12}
Before:
/
|-- css/
| `-- hello.css
| `-- world.css
After:
/
|-- css/
| `-- hello.css
| `-- world.css
|-- dist/
| `-- columns
| `-- hello.css
| `-- world.css
Filter css files by mask:
1{ 2 "rules": { 3 "filesystem/bundle": ["on", { 4 "mask": "*.good.css", 5 "groups": ["1:1"] 6 }] 7 } 8}
Before:
/
|-- css/
| `-- hello.css
| `-- world.good.css
After:
/
|-- css/
| `-- hello.css
| `-- world.css
|-- dist/
| `-- world.good.css
You can even override transform
with your own config
:
1putout(filesystem, { 2 rules: { 3 'filesystem/bundle': ['on', { 4 transform: (source: string | string[], config) => string, 5 }], 6 }, 7});
Concut files:
1{ 2 "rules": { 3 "filesystem/bundle": ["on", { 4 "groups": ["hello.css"] 5 }] 6 } 7}
Before:
/
|-- css/
| `-- hello.css
| `-- world.css
After:
/
|-- css/
| `-- hello.css
| `-- world.css
|-- dist/
| `-- hello.css
Checkout in 🐊Putout Editor.
When from=/home/coderaiser/putout
and to=/
:
1{ 2 "rules": { 3 "filesystem/replace-cwd": ["on", { 4 "from": "/home/coderaiser/putout", 5 "to": "/" 6 }] 7 } 8}
1__putout_processor_filesystem(['/home/coderaiser/putout/', '/home/coderaiser/putout/README.md']);
1__putout_processor_filesystem(['/', '/README.md']);
Checkout in 🐊Putout Editor.
1["/", "/hello.xyz"]
1["/", [ 2 "/hello.xyz", 3 "hello world" 4]]
Write all files that was read before to Filesystem.
Checkout in 🐊Putout Editor.
1["/", [ 2 "/hello.xyz", 3 "hello world" 4]]
Checkout in 🐊Putout Editor.
Filesystem:
1-["/", "/package.json"] 2+["/", "/package.js"]
1{ 2 "plugins": [] 3}
1export default { 2 plugins: [], 3};
Checkout in 🐊Putout Editor:
Filesystem:
1-["/", "/package.js"] 2+["/", "/package.json"]
1{ 2 "plugins": [] 3}
1export default { 2 plugins: [], 3};
MIT
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
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
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
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-07-14
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