An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

[![npm](https://img.shields.io/npm/v/fs-resolver-fs.svg)](https://www.npmjs.com/package/fs-resolver-fs)
[![License](https://img.shields.io/badge/License-0BSD-blue.svg)](https://spdx.org/licenses/0BSD.html)
[![bundlejs](https://deno.bundlejs.com/?q=fs-resolver-fs\&badge=detailed)](https://bundlejs.com/?q=fs-resolver-fs)
[![downloads](http://img.shields.io/npm/dm/fs-resolver-fs.svg?style=flat-square)](https://npmjs.org/package/fs-resolver-fs)
[![GitHub Issues](https://img.shields.io/github/issues/arlac77/fs-resolver-fs.svg?style=flat-square)](https://github.com/arlac77/fs-resolver-fs/issues)
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Farlac77%2Ffs-resolver-fs%2Fbadge\&style=flat)](https://actions-badge.atrox.dev/arlac77/fs-resolver-fs/goto)
[![Styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Known Vulnerabilities](https://snyk.io/test/github/arlac77/fs-resolver-fs/badge.svg)](https://snyk.io/test/github/arlac77/fs-resolver-fs)
[![Coverage Status](https://coveralls.io/repos/arlac77/fs-resolver-fs/badge.svg)](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