https://github.com/truewinter/orderedjson
https://github.com/truewinter/orderedjson
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/truewinter/orderedjson
- Owner: TrueWinter
- License: mit
- Created: 2022-01-17T14:41:24.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-17T14:51:01.000Z (over 4 years ago)
- Last Synced: 2025-03-13T12:38:56.518Z (over 1 year ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# OrderedJSON
As the name suggests, OrderedJSON keeps the order in which key-value pairs were added. This is important for use-cases such as hashing or signing a JSON object.
## Installing
```sh
npm install --save @truewinter/orderedjson
```
## Usage
```js
var json = new OrderedJSON();
json.add('test', 'testing');
json.add('1234', 5678);
console.log(json.getJSON());
```
**Imporant**: Only the following value types are supported: string, number, boolean, array, JSON, OrderedJSON.