devkits-chmod-calculator
v1.0.7
Published
Calculate Unix file permissions between numeric (755) and symbolic (rwxr-xr-x) notation. Essential tool for developers working with Linux/Unix systems.
Maintainers
Readme
@devkits/chmod-calculator
Calculate Unix file permissions between numeric (755) and symbolic (rwxr-xr-x) notation. Essential tool for developers working with Linux/Unix systems.
💰 Support DevKits
Love these tools? Support development via Open Collective
- $5/mo - Supporter (priority support)
- $9/mo - Pro (early access to new tools)
- $29 - Lifetime (all current + future Pro features)
💎 Upgrade to DevKits Pro
Get access to 20+ premium tools including SQL to Code, Data Faker, JWT Generator, and more — all for $9 one-time.
💡 Pay with Crypto: BTC, ETH, USDT (TRC-20), SOL accepted. View crypto addresses
🧰 DevKits Pro Tools
This package is part of DevKits — 82+ free developer tools. The online Chmod Calculator includes visual permission builder and preset recommendations.
→ Try Visual Permission Builder
Installation
npm install @devkits/chmod-calculatorUsage
const { fromNumeric, toSymbolic, parsePermissions, toCommand, PRESETS } = require('@devkits/chmod-calculator');
// Convert numeric to symbolic
fromNumeric('755');
// 'rwxr-xr-x'
fromNumeric('644');
// 'rw-r--r--'
// Convert symbolic to numeric
toSymbolic('rwxr-xr-x');
// '755'
// Get detailed permission breakdown
parsePermissions('755');
// {
// numeric: '755',
// symbolic: 'rwxr-xr-x',
// owner: { value: 7, symbolic: 'rwx', read: true, write: true, execute: true },
// group: { value: 5, symbolic: 'r-x', read: true, write: false, execute: true },
// other: { value: 5, symbolic: 'r-x', read: true, write: false, execute: true }
// }
// Generate chmod command
toCommand('755', 'myscript.sh');
// 'chmod 755 myscript.sh'
// Access common presets
console.log(PRESETS['755']);
// 'Owner full, others read+execute (rwxr-xr-x)'API
fromNumeric(numeric)
Converts numeric chmod (e.g., '755') to symbolic notation (e.g., 'rwxr-xr-x').
toSymbolic(symbolic)
Converts symbolic notation to numeric chmod.
numericToSymbolic(num)
Converts a single permission digit (0-7) to symbolic (e.g., 5 → 'r-x').
symbolicToNumeric(symbolic)
Converts a single symbolic triplet to numeric (e.g., 'r-x' → 5).
toCommand(numeric, filename)
Generates a chmod command string.
parsePermissions(numeric)
Returns detailed breakdown of permissions for owner, group, and others.
PRESETS
Object containing common permission presets with descriptions.
Common Permission Presets
| Mode | Symbolic | Use Case | |------|----------|----------| | 777 | rwxrwxrwx | Everyone has full permissions (dangerous!) | | 755 | rwxr-xr-x | Executable scripts, directories | | 700 | rwx------ | Private directories | | 644 | rw-r--r-- | Regular files, web content | | 600 | rw------- | Private files, SSH keys | | 444 | r--r--r-- | Read-only files | | 400 | r-------- | Owner read-only |
See Also
🔧 More DevKits Tools
Free Tools (82+): | Tool | Description | |------|-------------| | base64-tool | Base64 encode/decode | | cron-parser | Cron expression parser | | csv-json-converter | CSV ↔ JSON converter | | diff-checker | Text comparison (LCS) | | docker-compose-parser | Docker Compose parser |
💎 DevKits Pro — $9 One-Time
Unlock 20+ premium tools with a single payment:
💡 Pay with Crypto: BTC, ETH, USDT (TRC-20), SOL accepted
🚀 Other Products from Us
| Product | Description | |---------|-------------| | Invoicely | Free invoice generator for freelancers | | SnapOG | Free OG image generator (20+ templates) |
License
MIT
