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
- Host: GitHub
- URL: https://github.com/arlac77/sftp-resolver-fs
- Owner: arlac77
- License: 0bsd
- Created: 2017-07-03T21:02:27.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2025-03-17T14:43:55.000Z (about 1 year ago)
- Last Synced: 2025-03-17T15:51:47.739Z (about 1 year ago)
- Topics: sftp
- Language: JavaScript
- Homepage:
- Size: 1.54 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/sftp-resolver-fs)
[](https://spdx.org/licenses/0BSD.html)
[](https://bundlejs.com/?q=sftp-resolver-fs)
[](https://npmjs.org/package/sftp-resolver-fs)
[](https://github.com/arlac77/sftp-resolver-fs/issues)
[](https://actions-badge.atrox.dev/arlac77/sftp-resolver-fs/goto)
[](https://github.com/prettier/prettier)
[](http://commitizen.github.io/cz-cli/)
[](https://snyk.io/test/github/arlac77/sftp-resolver-fs)
[](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