endianness
Advanced tools
Comparing version 7.0.0-alpha.0 to 7.0.0-alpha.1
# CHANGELOG | ||
## version 7.0.0 (2018-06-25) | ||
- export default function endianness(){} | ||
- Allow better use of this lib as a dependency: | ||
- package.json refactored with bundlers and ES6 envs in mind | ||
- endianness() as the default export | ||
@@ -6,0 +8,0 @@ ## version 6.0.0 (2018-06-21) |
{ | ||
"name": "endianness", | ||
"version": "7.0.0-alpha.0", | ||
"version": "7.0.0-alpha.1", | ||
"description": "Swap endianness in byte arrays.", | ||
@@ -9,3 +9,4 @@ "homepage": "https://github.com/rochars/endianness", | ||
"main": "./dist/endianness.cjs.js", | ||
"module": "./dist/endianness.js", | ||
"module": "./index.js", | ||
"es2015": "./dist/endianness.js", | ||
"browser": "./dist/endianness.umd.js", | ||
@@ -12,0 +13,0 @@ "jsdelivr": "./dist/endianness.min.js", |
@@ -19,6 +19,6 @@ # endianness | ||
## Example | ||
## Use | ||
### ES6 | ||
Import from the **endianness.js** module: | ||
```import``` endianness from the **endianness.js** module: | ||
```javascript | ||
@@ -28,3 +28,3 @@ import endianness from 'endianness.js'; | ||
// Swap endianness of one 64-bit value: | ||
bytes = [64, 9, 33, 251, 84, 68, 45, 24]; | ||
let bytes = [64, 9, 33, 251, 84, 68, 45, 24]; | ||
endianness(bytes, 8); | ||
@@ -34,3 +34,3 @@ ``` | ||
### Node | ||
require() the default export of the **endianness** module: | ||
```require()``` the **endianness** module: | ||
```javascript | ||
@@ -40,3 +40,3 @@ const endianness = require("endianness"); | ||
// Swap endianness of two 24-bit values: | ||
bytes = ["00", "00", "80", "ff", "ff", "7f"]; | ||
let bytes = ["00", "00", "80", "ff", "ff", "7f"]; | ||
endianness(bytes, 3), | ||
@@ -46,3 +46,3 @@ ``` | ||
### Browser | ||
Use the compiled file **endianness.min.js** in the **/dist** folder: | ||
Use the compiled file **endianness.min.js** in the **dist/** folder: | ||
```html | ||
@@ -59,3 +59,3 @@ <script src="endianness.min.js"></script> | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/endianness@6"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/endianness@7"></script> | ||
``` | ||
@@ -65,5 +65,13 @@ | ||
```html | ||
<script src="https://unpkg.com/endianness@6"></script> | ||
<script src="https://unpkg.com/endianness@7"></script> | ||
``` | ||
Or as a ES6 module for modern browsers from [jspm](https://jspm.io): | ||
```html | ||
<script type="module"> | ||
import endianness from 'https://dev.jspm.io/endianness'; | ||
// your code | ||
</script> | ||
``` | ||
## API | ||
@@ -83,3 +91,3 @@ ```javascript | ||
## Distribution | ||
This library is a ES6 module also distributed as a CommonJS module, UMD and a compiled script for browsers. | ||
This library is a ES6 module also distributed as a CommonJS module, UMD module and a compiled script for browsers. | ||
@@ -89,3 +97,3 @@ - The **CommonJS** is the one used by Node. It is served in the "main" field of package.json | ||
- The **compiled dist** is browser-only and should be the one served by CDNs. | ||
- The **ES6** dist is **endianness.js**, served as "module" in package.json | ||
- The **ES6** dist is **endianness.js** | ||
@@ -92,0 +100,0 @@ You may load both **endianness.umd.js** and **endianness.min.js** in the browser with ```<script>``` tags. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114
19897
9
292