-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added scripts for newly available build versions
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,8 @@ isApng(buffer) | |
|
||
### Browser <img src="./src/chrome.svg" alt="Chrome" title="Chrome" style="margin-bottom:-0.15em"> <img src="./src/edge.svg" alt="Edge" title="Edge" style="margin-bottom:-0.15em"> <img src="./src/firefox.svg" alt="Firefox" title="Firefox" style="margin-bottom:-0.15em"> <img src="./src/safari.svg" alt="Safari" title="Safari" style="margin-bottom:-0.15em"> <img src="./src/opera.svg" alt="Opera" title="Opera" style="margin-bottom:-0.15em"> | ||
|
||
#### As package through NPM | ||
|
||
```js | ||
import isApng from 'is-apng' | ||
|
||
|
@@ -34,6 +36,55 @@ isApng(new Uint8Array(buffer)) | |
// => true | ||
``` | ||
|
||
#### As old-school global script tag | ||
|
||
Url for latest version: `https://unpkg.com/is-apng`<br> | ||
Url for specific version: `https://unpkg.com/[email protected]/dist/index.js` | ||
|
||
```html | ||
<script src="https://unpkg.com/is-apng" type="text/javascript"></script> | ||
|
||
<script type="text/javascript"> | ||
console.log(typeof isApng); | ||
// isApng(...) | ||
</script> | ||
``` | ||
|
||
#### As module | ||
|
||
Url for latest version: `https://unpkg.com/is-apng/dist/index.esm.js`<br> | ||
Url for specific version: `https://unpkg.com/[email protected]/dist/index.esm.js` | ||
|
||
```html | ||
<script type="module"> | ||
import isApng from 'https://unpkg.com/is-apng/dist/index.esm.js' | ||
console.log(typeof isApng); | ||
// isApng(...) | ||
</script> | ||
``` | ||
|
||
or | ||
|
||
```html | ||
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script> | ||
|
||
<script type="importmap"> | ||
{ | ||
"imports": { | ||
"is-apng": "https://unpkg.com/is-apng/dist/index.esm.js" | ||
} | ||
} | ||
</script> | ||
|
||
<script type="module"> | ||
import isApng from 'is-apng' | ||
console.log(typeof isApng); | ||
// isApng(...) | ||
</script> | ||
``` | ||
|
||
## API | ||
|
||
### isApng(buffer) | ||
|