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, flow, 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
56.6
Supply Chain
90.3
Quality
82.4
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
176,989
Last Day
1,210
Last Week
4,345
Last Month
21,118
Last Year
158,948
722 Stars
14,751 Commits
40 Forks
10 Watching
46 Branches
24 Contributors
Minified
Minified + Gzipped
Latest Version
7.0.0
Package Id
@putout/plugin-filesystem@7.0.0
Unpacked Size
34.78 kB
Size
8.70 kB
File Count
23
NPM Version
10.9.0
Node Version
22.12.0
Publised On
11 Jan 2025
Cumulative downloads
Total Downloads
Last day
-17.2%
1,210
Compared to previous day
Last week
-33.1%
4,345
Compared to previous week
Last month
14.9%
21,118
Compared to previous month
Last year
781%
158,948
Compared to previous year
🐊Putout plugin helps to lint filesystem.
npm i @putout/plugin-filesystem -D
1{ 2 "rules": { 3 "filesystem/remove-vim-swap-file": "on", 4 "filesystem/bundle": "off", 5 "filesystem/read-all-files": ["off", { 6 "mask": "*" 7 }], 8 "filesystem/write-all-files": "off", 9 "filesystem/rename-file": "off", 10 "filesystem/remove-files": "off", 11 "filesystem/rename-spec-to-test": "off", 12 "filesystem/rename-test-to-spec": "off", 13 "filesystem/rename-referenced-file": "off", 14 "filesystem/move-referenced-file": "off", 15 "filesystem/convert-simple-filesystem-to-filesystem": "off", 16 "filesystem/replace-cwd": ["off", { 17 "from": "/home/coderaiser/putout", 18 "to": "/" 19 }], 20 "filesystem/convert-json-to-js": ["off", { 21 "filename": "package.json" 22 }], 23 "filesystem/convert-js-to-json": ["off", { 24 "filename": "package.js" 25 }] 26 } 27}
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-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});
Concreate 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
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