# nv-json-length

> nv-json-length ======================= - get json's string-length AND buffer-size without stringify-it - its simple, just using a fixed length-lookup-array to increase the speed - slightly faster IF size < 1M; 30%~50% faster IF size >8M

Latest version **1.0.1** (published 2023-06-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install nv-json-length
pnpm add nv-json-length
yarn add nv-json-length
bun add nv-json-length
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-06-27 |
| First published | 2023-06-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 14.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ihgazni2 |

## Links

- npm: https://www.npmjs.com/package/nv-json-length
- npm.io page: https://npm.io/package/nv-json-length

## Dependencies (2)

- [nv-facutil-csutil](https://npm.io/package/nv-facutil-csutil.md) ^1.0.3
- [nv-facutil-jswitch](https://npm.io/package/nv-facutil-jswitch.md) ^1.0.12

## Recent versions

- 1.0.1 (latest) — 2023-06-27

## README

nv-json-length
=======================
- get json's string-length  AND buffer-size without stringify-it
- its simple, just using a fixed length-lookup-array to increase the speed
- slightly faster  IF size < 1M;   30%~50% faster IF size >8M 

install
=======
- npm install nv-json-length

splitted
--------


usage
=====
    
      const { 

            slen_aft_stringify,
            u8blen_aft_stringify     
 
      }   = require("nv-json-length");
 

example
-------

### small json  1-4k 

			{
			  rounds: 1000000,
			  f: [Function: using_json_dot_stringify_dot_length],
			  costed: 6014.261669635773
			}
			{
			  rounds: 1000000,
			  f: [Function: using_slen_aft_stringify],
			  costed: 4571.413624763489
			}
			1606 1606
			{
			  rounds: 1000000,
			  f: [Function: using_buffer_from_json_dot_stringify_dot_length],
			  costed: 9921.201370716095
			}
			{
			  rounds: 1000000,
			  f: [Function: using_u8blen_aft_stringify],
			  costed: 4624.248408794403
			}

### big json 16M 


		15960001 15960001
		{
		  rounds: 100,
		  f: [Function: using_json_dot_stringify_dot_length],
		  costed: 7460.39946603775
		}
		{
		  rounds: 100,
		  f: [Function: using_slen_aft_stringify],
		  costed: 4608.779390335083
		}
		16010001 16010001
		{
		  rounds: 100,
		  f: [Function: using_buffer_from_json_dot_stringify_dot_length],
		  costed: 13716.670814037323
		}
		{
		  rounds: 100,
		  f: [Function: using_u8blen_aft_stringify],
		  costed: 4531.97597694397
		}

METHODS
========


APIS
=======


		{
		  ndlen: [Function: ndlen],
		  AFT_JSTRINGIFY_SLEN_TBL: [
		    6, 6, 6, 6, 6, 6, 6, 6, 2, 2, 2, 6,
		    2, 2, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
		    6, 6, 6, 6, 6, 6, 6, 6, 1, 1, 2, 1,
		    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
		    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
		    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
		    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
		    1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1,
		    1, 1, 1, 1,
		    ... 65436 more items
		  ],
		  slen_aft_stringify_if_dtype_is_str: [Function: slen_aft_stringify_if_dtype_is_str],
		  slen_aft_stringify: [Function: slen_aft_stringify],
		  AFT_JSTRINGIFY_U8BLEN_TBL: [
		    6, 6, 6, 6, 6, 6, 6, 6, 2, 2, 2, 6,
		    2, 2, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
		    6, 6, 6, 6, 6, 6, 6, 6, 1, 1, 2, 1,
		    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
		    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
		    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
		    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
		    1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1,
		    1, 1, 1, 1,
		    ... 65436 more items
		  ],
		  u8blen_aft_stringify_if_dtype_is_str: [Function: u8blen_aft_stringify_if_dtype_is_str],
		  u8blen_aft_stringify: [Function: u8blen_aft_stringify]
		}

LICENSE
=======
- ISC

---
_Source: https://npm.io/package/nv-json-length · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
