0.1.0 • Published 7 years ago

xec v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

xec

xec on NPM

An async script loader, for the browser, built on Promises.

Pronounced "exec".

Install

npm i xec --save

API

xec exports a singleton, and won't load the same source twice.

It exposes the following API:

.one(source)

import { one } from 'xec'

one('path/one.js')
  .then(() => console.log('Script loaded and executed.'))
  .catch(() => console.log('Something went wrong.'))

.many(sources)

import { many } from 'xec'

const sources = [
  'path/one.js',
  'path/two.js'
]

many(sources)
  .then(() => console.log('All scripts loaded and executed.'))
  .catch(() => console.log('Something went wrong.'))

Browser Support

  1. Async script loading requires async attribute support.
  2. Promises are required. If needed, polyfill them.

License

MIT. © 2017 Michael Cavalea

0.1.0

7 years ago

0.0.4

7 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago