1 | # edgecast-purge
|
2 |
|
3 | ![Node](https://img.shields.io/node/v/edgecast-purge.svg?style=flat-square)
|
4 | [![NPM](https://img.shields.io/npm/v/edgecast-purge.svg?style=flat-square)](https://www.npmjs.com/package/edgecast-purge)
|
5 | [![Travis](https://img.shields.io/travis/gnitnuj/edgecast-purge/master.svg?style=flat-square)](https://travis-ci.org/gnitnuj/edgecast-purge)
|
6 | [![David](https://img.shields.io/david/gnitnuj/edgecast-purge.svg?style=flat-square)](https://david-dm.org/gnitnuj/edgecast-purge)
|
7 | [![Coverage Status](https://img.shields.io/coveralls/gnitnuj/edgecast-purge.svg?style=flat-square)](https://coveralls.io/github/gnitnuj/edgecast-purge)
|
8 | [![NPM](https://img.shields.io/npm/dt/edgecast-purge.svg?style=flat-square)](https://www.npmjs.com/package/edgecast-purge)
|
9 |
|
10 | > a service to purge media from edgecast's cache
|
11 |
|
12 | ### Installation
|
13 |
|
14 | Install via [yarn](https://github.com/yarnpkg/yarn)
|
15 |
|
16 | yarn add edgecast-purge (--dev)
|
17 |
|
18 | or npm
|
19 |
|
20 | npm install edgecast-purge (--save-dev)
|
21 |
|
22 | ### Usage
|
23 |
|
24 | ```js
|
25 | import edgecastPurge from 'edgecast-purge';
|
26 | ```
|
27 |
|
28 | ### methods
|
29 |
|
30 | #### init
|
31 |
|
32 | ```js
|
33 | const Edgecast = require('edgecast-purge');
|
34 | const edgecastService = new Edgecast('your-edgecast-token', 'your-edgecast-account-id');
|
35 | ```
|
36 |
|
37 | #### purge multiple urls
|
38 |
|
39 | ```js
|
40 | edgecastService.purge(['first-url', 'second-url', 'nth-url']);
|
41 | ```
|
42 |
|
43 | #### purge single url
|
44 |
|
45 | ```js
|
46 | edgecastService.purge('single-url');
|
47 | ```
|
48 |
|
49 | ### Examples
|
50 |
|
51 | See [`example`](example/script.js) folder.
|
52 |
|
53 | ### Builds
|
54 |
|
55 | `edgecast-purge` is compiled as a collection of [CommonJS](http://webpack.github.io/docs/commonjs.html) modules & [ES2015 modules](http://www.2ality.com/2014/0
|
56 | -9/es6-modules-final.html) for bundlers that support the `jsnext:main` or `module` field in package.json (Rollup, Webpack 2)
|
57 |
|
58 | The `edgecast-purge` package includes precompiled production and development [UMD](https://github.com/umdjs/umd) builds in the [`dist/umd` folder](https://unpkg.com/edgecast-purge/dist/umd/). They can be used directly without a bundler and are thus compatible with many popular JavaScript module loaders and environments. You can drop a UMD build as a [`<script>` tag](https://unpkg.com/edgecast-purge) on your page. The UMD builds make `edgecast-purge` available as a `window.edgecastPurge` global variable.
|
59 |
|
60 | ### License
|
61 |
|
62 | The code is available under the [MIT](LICENSE) license.
|
63 |
|
64 | ### Contributing
|
65 |
|
66 | We are open to contributions, see [CONTRIBUTING.md](CONTRIBUTING.md) for more info.
|
67 |
|
68 | ### Misc
|
69 |
|
70 | This module was created using [generator-module-boilerplate](https://github.com/duivvv/generator-module-boilerplate).
|