uri-resolver
resolves uris and provides fs like access
API Reference
Promise
get(url) ⇒ Creates a readable stream for the content of th file associated to a given file URL
Kind: global function
Fulfil: ReadableStream
- of the file content
Param | Type | Description |
---|---|---|
url | String |
of the a file |
Promise
stat(url) ⇒ Read stat of a file assiciacted to a given file URL
Kind: global function
Fulfil: Object
- as delivered by fs.stat()
Reject: Error
- if url is not a file url or fs.stat() error
Param | Type | Description |
---|---|---|
url | String |
of the a file |
Promise
put(url) ⇒ Put content of a stream to a file assiciacted to a given file URL
Kind: global function
Fulfil: Void
- undefined
Reject: Error
- if url is not a file url
Param | Type | Description |
---|---|---|
url | String |
of the a file |
Promise
delete(url) ⇒ Deletes the file assiciacted to a given file URL
Kind: global function
Fulfil: Void
- undefined
Reject: Error
- as delivered by fs.unlink()
Param | Type | Description |
---|---|---|
url | String |
of the a file |
Promise
list(url) ⇒ List content of a directory
Kind: global function
Fulfil: String[]
- file names
Reject: Error
- as delivered by fs.readdir()
Param | Type | Description |
---|---|---|
url | String |
of the a directory |
URIScheme
schemeForURI(uri) ⇒ get URIScheme for a given uri
Kind: global function
Returns: URIScheme
- for a given uri
Param | Type |
---|---|
uri | String |
install
With npm do:
npm install uri-resolver
license
BSD-2-Clause