1.0.0 • Published 7 years ago

require-uri v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

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.

NameTypeDefaultDescription
typestring"local"connection type. can specify these type of connection. "local", "http", "https", "ftp"
cachingbooleantruecache option for specified module. if false, require-uri will not make cache of specified module.
userstringanonymoususer string that will be used at authorization.
passwordstringanonymous@password that will be used at authorization.
hoststring-the host where specified module is hosted.
portinteger-Port number of host. The default value depends on type of connection.

Licence

This project is licensed under the terms of the MIT license