Gathering detailed insights and metrics for vscode-fsevents
Gathering detailed insights and metrics for vscode-fsevents
Gathering detailed insights and metrics for vscode-fsevents
Gathering detailed insights and metrics for vscode-fsevents
npm install vscode-fsevents
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
568 Stars
277 Commits
119 Forks
33 Watching
3 Branches
35 Contributors
Updated on 26 Oct 2024
C (50.64%)
JavaScript (44.83%)
Python (2.81%)
Shell (1.72%)
Cumulative downloads
Total Downloads
Last day
8.5%
51
Compared to previous day
Last week
19.9%
289
Compared to previous week
Last month
-22.6%
1,415
Compared to previous month
Last year
10.2%
13,411
Compared to previous year
Native access to MacOS FSEvents in Node.js
The FSEvents API in MacOS allows applications to register for notifications of changes to a given directory tree. It is a very fast and lightweight alternative to kqueue.
This is a low-level library. For a cross-platform file watching module that uses fsevents, check out Chokidar.
1npm install fsevents
Supports only Node.js v8.16 and higher.
1const fsevents = require('fsevents'); 2 3// To start observation 4const stop = fsevents.watch(__dirname, (path, flags, id) => { 5 const info = fsevents.getInfo(path, flags); 6}); 7 8// To end observation 9stop();
Important note: The API behaviour is slightly different from typical JS APIs. The
stop
function must be retrieved and stored somewhere, even if you don't plan to stop the watcher. If you forget it, the garbage collector will eventually kick in, the watcher will be unregistered, and your callbacks won't be called anymore.
The callback passed as the second parameter to .watch
get's called whenever the operating system detects a
a change in the file system. It takes three arguments:
fsevents.watch(dirname: string, (path: string, flags: number, id: string) => void): () => Promise<undefined>
path: string
- the item in the filesystem that have been changedflags: number
- a numeric value describing what the change wasid: string
- an unique-id identifying this specific eventReturns closer callback which when called returns a Promise resolving when the watcher process has been shut down.
fsevents.getInfo(path: string, flags: number, id: string): FsEventInfo
The getInfo
function takes the path
, flags
and id
arguments and converts those parameters into a structure
that is easier to digest to determine what the change was.
The FsEventsInfo
has the following shape:
1/** 2 * @typedef {'created'|'modified'|'deleted'|'moved'|'root-changed'|'cloned'|'unknown'} FsEventsEvent 3 * @typedef {'file'|'directory'|'symlink'} FsEventsType 4 */ 5{ 6 "event": "created", // {FsEventsEvent} 7 "path": "file.txt", 8 "type": "file", // {FsEventsType} 9 "changes": { 10 "inode": true, // Had iNode Meta-Information changed 11 "finder": false, // Had Finder Meta-Data changed 12 "access": false, // Had access permissions changed 13 "xattrs": false // Had xAttributes changed 14 }, 15 "flags": 0x100000000 16}
EBADPLATFORM
Unsupported platform for fsevents
error.The MIT License Copyright (C) 2010-2020 by Philipp Dunkel, Ben Noordhuis, Elan Shankar, Paul Miller — see LICENSE file.
Visit our GitHub page and NPM Page
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 7/22 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
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