https://github.com/cloudcmd/loadremote
library for loading modules from cdn or local file system
https://github.com/cloudcmd/loadremote
cdn cloudcmd file load remote
Last synced: about 2 months ago
JSON representation
library for loading modules from cdn or local file system
- Host: GitHub
- URL: https://github.com/cloudcmd/loadremote
- Owner: cloudcmd
- License: mit
- Created: 2015-07-10T07:24:33.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-10-25T09:39:52.000Z (over 9 years ago)
- Last Synced: 2025-05-11T17:41:31.194Z (9 months ago)
- Topics: cdn, cloudcmd, file, load, remote
- Language: JavaScript
- Size: 12.7 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog
- License: LICENSE
Awesome Lists containing this project
README
# Load Remote
Library for loading modules from cdn or local file system.
## Install
```
bower i loadremote --save
```
## How to use?
You should create files `modules.json` similar to this:
```json
[{
"name": "socket",
"version": "1.3.5",
"local": "/socket.io/socket.io.js",
"remote": "//cdn.socket.io/socket.io-{{ version }}.js"
}]
```
And `options.js`:
```json
{
"online": true
}
```
Then load [execon](https://github.com/coderaiser/execon "Execon") and `lib/load-remote.js`
and run this code:
```js
loadRemote('socket', { /* name of module in modules.json */
name : 'io', { /* name of variable in window object */
prefix: prefix, /* prefix for loading modules.json and options.json (could be empty) */
noPrefix: true /* do not add prefix to socket local url */
}, callback);
```
## License
MIT