require-from-web
v1.2.0
Published
Import/Load/Require module from url
Downloads
1,201
Maintainers
Readme
Require From Web
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/[email protected]/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.