Gathering detailed insights and metrics for omni-vfs
Gathering detailed insights and metrics for omni-vfs
Gathering detailed insights and metrics for omni-vfs
Gathering detailed insights and metrics for omni-vfs
npm install omni-vfs
Typescript
Module System
Node Version
NPM Version
67.9
Supply Chain
85.6
Quality
74.8
Maintenance
100
Vulnerability
99.6
License
Total Downloads
1,616
Last Day
1
Last Week
2
Last Month
12
Last Year
72
Minified
Minified + Gzipped
Latest Version
0.0.2
Package Id
omni-vfs@0.0.2
Size
2.87 kB
NPM Version
2.13.0
Node Version
2.4.0
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
-66.7%
2
Compared to previous week
Last month
50%
12
Compared to previous month
Last year
-20%
72
Compared to previous year
2
Omni, a virtual file system.
This package only includes the base classes for the virtual file systems, you need to install one (or more) of the various implementations before you can start using Omni.
OmniBase
This is an abstract base class, you need to install one of the implementations to use these methods
readdir(path: string) → Promise.<Array.<string>>
Read the contents of a directory, returns an array of filenames.
readfile(path: string) → Promise.<ReadableStream>
stat(path: string) → Promise.<Stats>
Get a Stats
object for a node.
statType(path: string) → Promise.<string>
Convenience method for getting the type of a node, returns 'file'
or 'directory'
. By default this method simply calls .stat()
, but this can potentially be overridden for performance reasons by other VFS implementations.
walk(path: string, [options: object]) → EventEmitter
Recursively walk over the nodes in a directory.
options.shouldStat: function(path: string) → boolean
- If this callback returns false
, no stat called is made for this node, this also means that no file
or directory
event will be fired. Returns true
by default.options.shouldEnter: function(path: string) → boolean
- If this callback returns false
, the directory will not be entered by the walker, a directory
event will still be fired. Returns true
by default.options.concurrency: number
- The number of workers to run in parallel. This is directly passed to async.queue
. Defaults to 1
..on('directory', function(path: string))
.on('file', function(path: string))
.on('end', function())
.on('error', function(error: Error))
1const walker = vfs.walk('base/directory'); 2walker.on('directory', (path) => console.log(path)); 3walker.on('end', () => console.log('ended'));
Stats
type: string
The type of the node, either file
or directory
.
mime: string
The MIME type of the node. Note that the value of this is up to the VFS implementation.
isDirectory: boolean
Whether the node is a directory, simply a convenience method for checking type == 'directory'
.
isFile: boolean
Whether the node is a file, simply a convenience method for checking type == 'file'
.
fs
.Extend the abstract OmniBase
class and implement the unimplemented methods, optionally overriding already implemented methods (such as .walk()
and .statType()
) for performance reasons.
No vulnerabilities found.
No security vulnerabilities found.