28.0.0 • Published 2 years ago

jest-serializer v28.0.0

Weekly downloads
12,898,652
License
MIT
Repository
github
Last release
2 years ago

jest-serializer

DEPRECATED: Use v8 APIs directly: https://nodejs.org/api/v8.html#serialization-api

Module for serializing and deserializing object into memory and disk. The Node core v8 implementations are used. This seriializer have the advantage of being able to serialize Map, Set, undefined, NaN, etc..

Install

$ yarn add jest-serializer

API

Three kinds of API groups are exposed:

In-memory serialization: serialize and deserialize

This set of functions take or return a Buffer. All the process happens in memory. This is useful when willing to transfer over HTTP, TCP or via UNIX pipes.

import {deserialize, serialize} from 'jest-serializer';

const myObject = {
  foo: 'bar',
  baz: [0, true, '2', [], {}],
};

const buffer = serialize(myObject);
const myCopyObject = deserialize(buffer);

Synchronous persistent filesystem: readFileSync and writeFileSync

This set of functions allow to send to disk a serialization result and retrieve it back, in a synchronous way. It mimics the fs API so it looks familiar.

import {readFileSync, writeFileSync} from 'jest-serializer';

const myObject = {
  foo: 'bar',
  baz: [0, true, '2', [], {}],
};

const myFile = '/tmp/obj';

writeFileSync(myFile, myObject);
const myCopyObject = readFileSync(myFile);
archetype-libraryreact-native-bluetooth2killi8n-react-native-fast-imagereact-native-itabletrn-send-smsspecify-importsbabel-specify-imports@icanpm/api-masterreact-native-template-rfbaseairscanairscan-examplereact-native-esc-pos-sahaab@borisovart/atol-kkt-moduledeneme323112@ntt_app/react-native-custom-notificationreact-native-custom-text-hwjamesreact-native-covid-sdkgql_din_modbitgetreact-native-thanh-toast-library@thanhnguyen14797/react-native-thanh-toast-library@olivervorasai/sliderreact-native-printer-brothersrn-pdf-reader-offlinereact-native-shekhar-bridge-testwilscanner@oiti/documentoscopy-react-native@mink-opn/build-tokensquoc-testreact-native-slider-kf@saaspe/componentsplginexpand-react-bridgesklif-ui-kitsklif-api@everything-registry/sub-chunk-1956p149-tablesklif-ui@geeky-apo/react-native-advanced-clipboardlib-errorhexyun.helpershot-zone-vuekhaled-salem-custom-componentsgogency-test-2gogencygoogle-remakelancetyersemproj3iex-sdkmoonwalkerswap-default-token-listsnew-example-projectnka-gantt-task-reactmarkdown-links-ymobtimer-api2microend-componentmpesa-cookiempesa-cookie-jarjulien-easy-modaljrennsoh88-react-native-scroll-indicatornative-date-picker-modulenative-modal-damage-vehiclenative-kakao-loginnative-google-loginnative-apple-loginmy-library-buttonmy-greeter-packagemy-calc-boxnew-awesome-4321mama-exportermap-values-resolverlrn_metro-cachenove-repositorynotion-database-exporternpm_qwertynpm_one_12_34_1_npm_one_1_2_3npm_one_2_2npm-package-mentorcheckmavectramd-vditor@simstudio/htmldiffzzzxxxyyy321123epm-npm-tscdskcorenewes-react-bridgefront-and-backgaurav-react-native-loopgriffin-ui-librarygrids-over-polygongzup-react-image-file-resizerfrdrk-js-semaphoregenz-native-elementsevanutilsfn-lib-examplefmslex-ikon-components-librarynpm-all-packagesnumhandlerpyreswap-sdkraact-native-arunramya151polen-web-components-react
28.0.0

2 years ago

28.0.0-alpha.6

2 years ago

28.0.0-alpha.3

2 years ago

27.5.0

2 years ago

27.5.1

2 years ago

28.0.0-alpha.0

2 years ago

28.0.0-alpha.2

2 years ago

28.0.0-alpha.1

2 years ago

27.4.0

2 years ago

27.0.6

3 years ago

27.0.1

3 years ago

27.0.0-next.9

3 years ago

27.0.0-next.0

3 years ago

26.6.2

3 years ago

26.5.0

3 years ago

26.3.0

4 years ago

26.2.0

4 years ago

26.1.0

4 years ago

26.0.0

4 years ago

26.0.0-alpha.0

4 years ago

25.5.0

4 years ago

25.2.6

4 years ago

25.2.1

4 years ago

25.2.1-alpha.1

4 years ago

25.2.1-alpha.2

4 years ago

25.2.0

4 years ago

25.2.0-alpha.86

4 years ago

25.1.0

4 years ago

25.0.0

5 years ago

24.9.0

5 years ago

24.4.0

5 years ago

24.3.0

5 years ago

24.2.0-alpha.0

5 years ago

24.0.0

5 years ago

24.0.0-alpha.16

5 years ago

24.0.0-alpha.15

5 years ago

24.0.0-alpha.13

5 years ago

24.0.0-alpha.12

5 years ago

24.0.0-alpha.11

5 years ago

24.0.0-alpha.10

5 years ago

24.0.0-alpha.9

5 years ago

24.0.0-alpha.7

5 years ago

24.0.0-alpha.6

5 years ago

24.0.0-alpha.5

5 years ago

24.0.0-alpha.4

5 years ago

24.0.0-alpha.2

5 years ago

24.0.0-alpha.1

5 years ago

24.0.0-alpha.0

5 years ago

23.0.1

6 years ago

23.0.0

6 years ago

23.0.0-charlie.4

6 years ago

23.0.0-charlie.3

6 years ago

23.0.0-charlie.2

6 years ago

23.0.0-charlie.1

6 years ago

23.0.0-charlie.0

6 years ago

23.0.0-beta.3r

6 years ago

23.0.0-alpha.3r

6 years ago

23.0.0-beta.2

6 years ago

23.0.0-beta.1

6 years ago

23.0.0-beta.0

6 years ago

23.0.0-alpha.7

6 years ago

22.4.3

6 years ago

22.4.0

6 years ago