-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
14 additions
and
5 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 |
---|---|---|
@@ -1,22 +1,31 @@ | ||
# LFS pack | ||
|
||
JavaScript library used for packing and unpacking [LFS](https://lfs.net) [InSim](https://en.lfsmanual.net/wiki/InSim) packets | ||
|
||
[![Build Status](https://travis-ci.com/makao/lfs-pack.svg?branch=master)](https://travis-ci.com/makao/lfs-pack) | ||
[![Coverage Status](https://coveralls.io/repos/github/makao/lfs-pack/badge.svg?branch=master)](https://coveralls.io/github/makao/lfs-pack?branch=master) | ||
|
||
JavaScript library used for packing and unpacking LFS packets | ||
## Installation | ||
|
||
```bash | ||
npm install --save @makao.pl/lfs-pack | ||
``` | ||
|
||
## Example | ||
## Usage | ||
|
||
#### Pack | ||
__Pack__ | ||
```javascript | ||
// packing 4 unsigned chars into buffer | ||
const buffer = pack('CCCC', [10, 20, 30, 40]); | ||
console.log(buffer); // <Buffer 0a 14 1e 28> | ||
``` | ||
|
||
#### Unpack | ||
__Unpack__ | ||
```javascript | ||
// unpacking 4 unsigned chars from buffer | ||
const values = unpack('CCCC', Buffer.alloc(4)); | ||
console.log(values); // [0, 0, 0, 0] | ||
``` | ||
|
||
## License | ||
[MIT](https://choosealicense.com/licenses/mit/) |
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