require-from-web
Import/Load/Require module from url
Last updated 6 months ago by tiagodanin .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install require-from-web 
SYNC missed versions from official npm registry.

Require From Web

Travis Downloads Node Version XO code style

Import/Load/Require module from url

Installation

Module available through the npm registry. It can be installed using the npm or yarn command line tools.

# NPM
npm install require-from-web --save
# Or Using Yarn
yarn add require-from-web

Example

const requireFromWeb = require('require-from-web')

const url = 'https://unpkg.com/jformat@1.0.4/index.js'

requireFromWeb(url).then(format => {
	const text = format('Forever {Python}', {Python: 'JavaScript'})
	console.log(text) // Forever JavaScript
})

Documentation

Options :: requireFromWeb(url, axiosOptions, code)

url

Url of file.

Type: String

axiosOptions**

Config/option of Axios.

Type: Object

code

Add more code in end script.

Type: String

Tests

To run the test suite, first install the dependencies, then run test:

# NPM
npm test
# Or Using Yarn
yarn test

Dependencies

  • axios: Promise based HTTP client for the browser and node.js

Dev Dependencies

  • xo: JavaScript happiness style linter ❤️

Contributors

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue. List of all contributors.

License

MIT © Tiago Danin

Current Tags

  • 1.2.0                                ...           latest (6 months ago)

4 Versions

  • 1.2.0                                ...           6 months ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 1
Last Month 10
Dependencies (1)
Dev Dependencies (1)
  • xo ^0.30.0

Copyright 2014 - 2017 © taobao.org |