Get cdn config from npm module name
$ npm install --save module-to-cdn
const moduleToCdn = require('module-to-cdn');
moduleToCdn('react', '15.3.0');
/* => {
name: 'react',
var: 'React',
url: 'https://unpkg.com/[email protected]/dist/react.min.js',
version: '15.3.0'
}
*/
return the result Object
or null (if module couldn't be find)
Type: string
The name of the module
Type: string
The version of the module
Type: string
Values: development
, production
Default: development
name
: name of the modulevar
: name of the global variable exposing the moduleurl
: url where the module is availableversion
: the version asked for
MIT © Thomas Sileghem