1.0.4 • Published 4 years ago
cross-require v1.0.4
Cross Require
A useless way to require things
Installation
You can either use the unpkg CDN or npm install cross-require
.
Node.js Usage
- fetches script and converts it into a module
const crossRequire = require('cross-require')
;(async () => {
const example = await crossRequire('https://source.js')
})
Browser Usage
- basically appends script to page
// include cross require at top of the page
;(async () => {
const example = await crossRequire('https://source.js')
// example contains fetched code as text
})