Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
@akryum/winattr
Advanced tools
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 >= 4
is required. To install, type this at the command line:
npm install @akryum/winattr
Or:
yarn add @akryum/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", function(err, attrs) {
if (err == null) console.log(attrs);
});
If you omit the callback, a Promise will be return instead.
getSync(path)
path
- Path to file or directory
Returns an Object
or throws an error if the file or dir cannot be found/accessed.
var 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}, function(err) {
if (err == null) console.log("success");
});
If you omit the callback, a Promise will be return instead.
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});
v3.0.0
Fixed:
New:
get
and set
return a Promise if no callback is provided.getSync()
,setSync()
useExec()
,useNative()
useExec()
"mode"fswin.find()
to fswin.getAttributes()
now that it's available, tested non-existent filesuseExec()
,useNative()
FAQs
Foolproof Windows® file attributes.
The npm package @akryum/winattr receives a total of 39,607 weekly downloads. As such, @akryum/winattr popularity was classified as popular.
We found that @akryum/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.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.