
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Foolproof Windows® file attributes for Node.js
Get and set:
archive
hidden
readonly
system
… on files and/or directories.
A native binding is used, offering great performance. As a contingency in case that fails, functionality will silently revert to a command line, though it is considerably slower.
It may go without saying, but this library is not intended to run on anything other than Windows.
Node.js >= 8
is required. To install, type this at the command line:
npm install winattr
get(path, callback)
path
- Path to file or directory
callback(err,attrs)
- A callback which is called upon completion
winattr.get('path/to/file.ext', (err, attrs) => {
if (err == null) {
console.log(attrs);
}
});
getSync(path)
path
- Path to file or directory
Returns an Object
or throws an error if the file or dir cannot be found/accessed.
const attrs = winattr.getSync('path/to/file.ext');
console.log(attrs);
set(path, attrs, callback)
path
- Path to file or directory
attrs
- An object containing attributes to change
callback(err)
- A callback which is called upon completion
winattr.set('path/to/folder/', {readonly:true}, err => {
if (err == null) {
console.log('success');
}
});
setSync(path, attrs)
path
- Path to file or directory
attrs
- An object containing attributes to change
Throws an error if the file or dir cannot be found/accessed.
winattr.setSync('path/to/folder/', {readonly:true});
FAQs
Foolproof Windows® file attributes.
The npm package winattr receives a total of 50,229 weekly downloads. As such, winattr popularity was classified as popular.
We found that winattr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.