1.0.0 • Published 7 years ago
require-uri v1.0.0
require-uri
This module make you can import/require a module from wherever with node.js.
currently supports loading module from ...
- Local storage
- HTTP
- HTTPS
- FTP
Installation
npm install require-uri
Usage
var requireUri = require("request-uri");
requireUri(/* source path or uri */).then(module => { /* do something */ });
API
requireUri(target , options)
target required
Type: string | string[]
Specific target module url, path, etc.
options optional
Type: object
Specific options of loading module, options can be specified like below.
Name | Type | Default | Description |
---|---|---|---|
type | string | "local" | connection type. can specify these type of connection. "local", "http", "https", "ftp" |
caching | boolean | true | cache option for specified module. if false, require-uri will not make cache of specified module. |
user | string | anonymous | user string that will be used at authorization. |
password | string | anonymous@ | password that will be used at authorization. |
host | string | - | the host where specified module is hosted. |
port | integer | - | Port number of host. The default value depends on type of connection. |
Licence
This project is licensed under the terms of the MIT license
1.0.0
7 years ago