https://github.com/bendrucker/json-size
Find the size (bytes) of a serialized object
https://github.com/bendrucker/json-size
Last synced: about 1 year ago
JSON representation
Find the size (bytes) of a serialized object
- Host: GitHub
- URL: https://github.com/bendrucker/json-size
- Owner: bendrucker
- License: mit
- Created: 2015-08-15T02:40:33.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-11-13T19:26:43.000Z (over 7 years ago)
- Last Synced: 2025-04-10T08:14:02.294Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# json-size [](https://travis-ci.org/bendrucker/json-size)
> Find the size (bytes) of a serialized object
## Install
```
$ npm install --save json-size
```
## Usage
```js
var jsonSize = require('json-size')
jsonSize({foo: 'bar'})
//=> 13
```
## API
#### `jsonSize(value)` -> `number`
Returns the number of bytes of the resulting JSON.
##### value
*Required*
Type: `any`
A value to stringify.
## License
MIT © [Ben Drucker](http://bendrucker.me)