Unix file permissions can take many shapes: symbolic (ug+rw
), octal (660
) or a list of characters (drw-rw----
).
unix-permissions
(https://github.com/ehmicky/unix-permissions) enables using any of these (instead of being limited to a single one) with any Node.js or CLI command.
This library can also perform operations on Unix permissions such as:
- testing, setting and unsetting. Using bitwise operations (
|
,&
,^
,~
) can be tedious and error-prone otherwise. - validating syntax.
- normalizing. For example
u+r,u+w
can be shortened tou+rw
. - inverting. For example a
umask
of117
means new files will be created with661
permissions. - checking the minimal or maximal permissions among a list of them. This can be useful to aggregate all the permissions of several files, e.g. during a directory recursion.
Feel free to provide me with feedback on dev.to or on GitHub!
Top comments (5)
This library is a game changer for managing Unix permissions! It’s so much easier to work with symbolic, octal, and character new squishmallows 2025 formats all in one place. The normalizing and inverting features are super useful for streamlining tasks. Definitely adding this to my dev toolkit!
This is seriously powerful—finally a clean way to handle all permission formats in one place. Saves so much time over manual bitwise grinchcostumes ops. The normalize and invert features are a game changer. Definitely adding this to my toolbelt for Node.js work!
Awesome library! Makes handling Unix permissions way less painful, especially with all the format flexibility. Love the normalize and morticia addams plus size costume invert features—they’re super handy. Definitely a must-use for any Node.js project dealing with file perms.
This tool is super helpful, makes permission handling so much easier, especially with different formats. Love the normalize and Meiziz Keychain invert features, they saved me a ton of time. Works great with Node.js and CLI commands too. Big thanks for building and sharing this!
This library looks super useful for handling Unix permissions in Node.js! I love that it supports symbolic, octal, and character-based permissions Army Job, making it flexible. The operations like validation and normalization will save a lot of time. I’ll definitely check it out!