From d64cf13f3a0769745426f97c4cd67737b3e769be Mon Sep 17 00:00:00 2001 From: Adam Coulombe Date: Mon, 29 Jan 2018 15:01:36 -0500 Subject: [PATCH 1/4] Add more detailed usage documentation --- README.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 42061ce..39513cc 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,56 @@ [https://davidmz.github.io/apng-js/](https://davidmz.github.io/apng-js/) ## Usage + +### Using Babel/Webpack + +This library is written using ES2015 Javascript. If you are already using [babel](https://babeljs.io), you can easily integrate this library with the following steps. + `npm install apng-js` - + +then, import `parseAPNG` into your app... + +``` +import parseAPNG from 'apng-js' + +const apng = parseAPNG( require('./images/elephant.png') ); + +``` + + + +### Using plain old Javascript + +Using a module loader like [requirejs](http://requirejs.org/): + +- Install the library: +-- `npm install apng-js` + +Then, import the compiled library (located @ `lib/index.js` using requirejs: + +``` + + +``` + ## API ### parseAPNG(buf: ArrayBuffer): (APNG|Error) From 64468119f87cdca65bdc83159f98d906bb7e916a Mon Sep 17 00:00:00 2001 From: Adam Coulombe Date: Mon, 29 Jan 2018 15:06:39 -0500 Subject: [PATCH 2/4] Add more detailed usage documentation --- README.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 39513cc..7b815b2 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This library is written using ES2015 Javascript. If you are already using [babel then, import `parseAPNG` into your app... -``` +```JavaScript import parseAPNG from 'apng-js' const apng = parseAPNG( require('./images/elephant.png') ); @@ -30,12 +30,11 @@ const apng = parseAPNG( require('./images/elephant.png') ); Using a module loader like [requirejs](http://requirejs.org/): -- Install the library: --- `npm install apng-js` +- Install the library: `npm install apng-js` Then, import the compiled library (located @ `lib/index.js` using requirejs: -``` +```JavaScript