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

https://github.com/arlac77/sftp-resolver-fs

resolves sftp urls
https://github.com/arlac77/sftp-resolver-fs

sftp

Last synced: about 1 year ago
JSON representation

resolves sftp urls

Awesome Lists containing this project

README

          

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

## sftp-resolver-fs

resolves sftp urls

# API

### Table of Contents

* [SFTPScheme](#sftpscheme)
* [Parameters](#parameters)
* [get](#get)
* [Parameters](#parameters-1)
* [name](#name)
* [defaultPort](#defaultport)
* [isSecure](#issecure)
* [optionsFromEnvironment](#optionsfromenvironment)
* [Parameters](#parameters-2)

## SFTPScheme

**Extends URLScheme**

URLScheme for sftp access

### Parameters

* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)

* `options.privateKey` **([UInt8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) | [Buffer](https://nodejs.org/api/buffer.html))**

### get

Creates a readable stream for the content of th file associated to a given file URL

#### Parameters

* `context` **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 **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\** of the file content

### name

Scheme name is 'sftp'

Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 'sftp'

### defaultPort

Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 22 the sftp default port

### isSecure

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true

### optionsFromEnvironment

Extract options suitable for the constructor
form the given set of environment variables

#### Parameters

* `env` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** undefined if no suitable environment variables have been found

# install

With [npm](http://npmjs.org) do:

```shell
npm install sftp-resolver-fs
```

# license

BSD-2-Clause