https://github.com/arlac77/fs-resolver-fs
resolves file urls
https://github.com/arlac77/fs-resolver-fs
Last synced: about 1 year ago
JSON representation
resolves file urls
- Host: GitHub
- URL: https://github.com/arlac77/fs-resolver-fs
- Owner: arlac77
- License: 0bsd
- Created: 2017-02-08T17:16:55.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-03-17T13:03:47.000Z (about 1 year ago)
- Last Synced: 2025-03-29T19:16:35.784Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 1.52 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/fs-resolver-fs)
[](https://spdx.org/licenses/0BSD.html)
[](https://bundlejs.com/?q=fs-resolver-fs)
[](https://npmjs.org/package/fs-resolver-fs)
[](https://github.com/arlac77/fs-resolver-fs/issues)
[](https://actions-badge.atrox.dev/arlac77/fs-resolver-fs/goto)
[](https://github.com/prettier/prettier)
[](http://commitizen.github.io/cz-cli/)
[](https://snyk.io/test/github/arlac77/fs-resolver-fs)
[](https://coveralls.io/github/arlac77/fs-resolver-fs)
## fs-resolver-fs
resolves file urls
# API
### Table of Contents
* [FileScheme](#filescheme)
* [get](#get)
* [Parameters](#parameters)
* [stat](#stat)
* [Parameters](#parameters-1)
* [put](#put)
* [Parameters](#parameters-2)
* [delete](#delete)
* [Parameters](#parameters-3)
* [list](#list)
* [Parameters](#parameters-4)
* [name](#name)
## FileScheme
**Extends URLScheme**
URLScheme for file system access
### get
Creates a readable stream for the content of th file associated to a given file URL
#### Parameters
* `context` **Context** execution context
* `url` **[URL](https://developer.mozilla.org/docs/Web/API/URL/URL)** of the a file
* `options` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))** passed as options to fs.createReadStream()
Returns **ReadableStream** of the file content
### stat
Read stat of a file assiciated to a given file URL
#### Parameters
* `context` **Context** execution context
* `url` **[URL](https://developer.mozilla.org/docs/Web/API/URL/URL)** of the a file
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** unused for now
Returns **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error))** as delivered by fs.stat()
### put
Put content of a stream to a file associated to a given file URL
#### Parameters
* `context` {Context} execution context
* `url` {URL} of the a file
* `stream` {Stream} data source
* `options` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))** passed as options to fs.createWriteStream()
Returns **([undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined) | [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error))** if url is not a file url
### delete
Deletes the file assiciated to a given file URL
#### Parameters
* `context` **Context** execution context
* `url` **[URL](https://developer.mozilla.org/docs/Web/API/URL/URL)** of the a file
Returns **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [Error](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error))** as delivered by fs.unlink()
### list
List content of a directory
#### Parameters
* `context` **Context** execution context
* `url` **[URL](https://developer.mozilla.org/docs/Web/API/URL/URL)** of the a directory
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** unused for now
Returns **Iterator**
### name
Scheme name if 'file'
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 'file'
# install
With [npm](http://npmjs.org) do:
```shell
npm install fs-resolver-fs
```
# license
BSD-2-Clause