3.1.6 • Published 5 years ago
@moyuyc/module-to-cdn v3.1.6
module-to-cdn

Get cdn config from npm module name
Install
$ npm install --save module-to-cdnUsage
const moduleToCdn = require('module-to-cdn');
moduleToCdn('react', '15.3.0');
/* => {
name: 'react',
var: 'React',
url: 'https://unpkg.com/react@15.3.0/dist/react.min.js',
version: '15.3.0'
}
*/API
moduleToCdn(moduleName, version, options)
return the result Object or null (if module couldn't be find)
moduleName
Type: string
The name of the module
version
Type: string
The version of the module
options
options.env
Type: string
Values: development, production
Default: development
options.endpoint
Type: string
Default: //unpkg.com/
options.modules
See default modules modules.json
options.versionSeg
Type: string
Default: @
Result
name: name of the modulevar: name of the global variable exposing the moduleurl: url where the module is availableversion: the version asked for
License
MIT © Thomas Sileghem