# @odczynflnpm/architecto-voluptate-tempore

> [![Project license](https://img.shields.io/badge/license-Apache2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Project license](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Discord](https://img.

Latest version **1.0.0** (published 2024-04-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @odczynflnpm/architecto-voluptate-tempore
pnpm add @odczynflnpm/architecto-voluptate-tempore
yarn add @odczynflnpm/architecto-voluptate-tempore
bun add @odczynflnpm/architecto-voluptate-tempore
```

## 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.0 |
| Published | 2024-04-25 |
| First published | 2024-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 22 |
| Unpacked size | 24.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | odczynFL |
| Maintainers | ducvinh101011z |
| Keywords | remove, concatMap, styled-components, streams, ECMAScript 2016, omit, create, Array.prototype.includes, tap, descriptors, functional, less mixins, toStringTag, mkdirp, lru, gradients css3, toArray, $.extend, regular, group, executable, deepcopy, browserslist, qs, gestures, monorepo, quote, warning, functions, names, utility, json-schema-validator, channel, codes, user-streams, yup, dom-testing-library, authentication, symlinks, full, helpers, await, environment, modules, obj, columns, less.js, lesscss, dir, contains, api, map, wait, signals, shebang, core, jsdiff, query, define, values, walk, _.extend, argparse, JSON, es, launch, link, multi-package, from, middleware, crypto, characters, WeakMap, crypt, jsdom, wordbreak, guid, website, file system, less css, zero, log, copy, RegExp#flags, eventEmitter, l10n, JSON-Schema, weakset, rmdir, querystring, react, xdg-open, setter, call, which, escape, valid, mkdirs, bootstrap css, sanitize, generics, touch, emit, performance, deep, description, ast, reducer, key, install, AsyncIterator, ECMAScript 2022, react pose, uuid, async, logger, jQuery, interrupts, ES2020, Array.prototype.flatMap, properties, form, byteOffset, fast-copy, prune, Object, findLast, ajv, groupBy, lint, 256, const, trimStart, is, column, compile less, es2018, compiler, match, error, serialize, typedarray, Observables, private data, mimetypes, parser, nodejs, URLSearchParams, bcrypt, toobject, findLastIndex, pyyaml, setImmediate, exit, auth, push, redact, isConcatSpreadable, hash, resolve, byteLength, @@toStringTag, hardlinks, transpiler, logging, Int8Array, language, coercible, real-time, ECMAScript 3, ava, json, apollo, dataview, getOwnPropertyDescriptor, toolkit, ansi, spinner, optimist, dayjs, terminal, safe, accessibility, streams2, output, wordwrap, es2017, asserts, zod, busy, shell, Object.fromEntries, eslintplugin, find, console, ES7, directory, arguments, es7, mime, set, curl, handlers, macos, path, picomatch, transpile, json-schema, invariant, metadata, trimRight, readablestream, graphql, pnpm9, eventDispatcher, rangeerror, symbol, fs, getter, ReactiveExtensions, view, function, forEach, package, matchAll, wget, es2015, toSorted, ECMAScript 2018, spec, flags, ES2017, opener, symlink, computed-types, folder, npm, bdd, fastify, rm, less, tape, ECMAScript 2020, value, reduce, property, regexp, assign, Push, deep-clone, postcss-plugin, editor, trim, defineProperty, WebSocket, Reflect.getPrototypeOf, length, character, css less, syntax, installer, gdpr, ECMAScript 7, ESnext, es8, ECMAScript 2023, mru, stringify, chai, look-up, syntaxerror, postcss, xss, random, assert, search, width, watching, code points, write, slice, styles, Underscore, stable, extension, autoprefixer, String.prototype.trim, persistent, arraybuffer, Object.assign, batch, consume, electron, Array.prototype.findLast, getintrinsic, ascii, buffer, css, redux-toolkit, awesomesauce, point-free, jsx, task, waapi, stringifier, parse, child, ECMAScript 2017, iterate, .env, express, term, command, debugger, settings, classnames, package manager, mime-db, tdd, start, nope, es-shim API, prefix, ES2022, slot, eslintconfig, utilities, ender, connect, a11y, config, shared, typedarrays, tester, tslib, urls, url, fast-deep-clone, concat, hasOwn, runtime, lockfile, colors, ECMAScript 2021, move, Object.keys, sorted, module, equality, Array.prototype.findLastIndex, curried, Array.prototype.contains, ts, recursive, option, Int32Array, events, arktype, css nesting, nested css, typeerror, deep-copy, ajax, unicode, offset, superagent, Object.is, queueMicrotask, process, number, last, util, rfc4122, ponyfill, listeners, debug, watcher, ES5, ECMAScript 6, ratelimit, [[Prototype]], protobuf, circular, Uint8Array, mkdir, inference, tostringtag, serialization, bundler, text, weakmap, array, test, extra, __proto__, Streams, styleguide, error-handling, fetch, fast, private, ramda, ArrayBuffer#slice, pipe, intrinsic, symbols, animation, prop, deterministic, callback, chromium, preserve-symlinks, setPrototypeOf, parent, promises, date, shrinkwrap, moment, Object.entries, diff, typed, RxJS, dependency manager, formatting, popmotion, ES, react-hook-form, Set, check, figlet, es-shims, Promise, call-bind, hooks, negative zero, getPrototypeOf, indicator, structuredClone, fullwidth, opens, TypeBox, cors, Iterator, framework, expression, fastclone, Rx, watch, status, idle, chinese, ES2019, bluebird, japanese, make, art, concurrency, Object.defineProperty, variables in css, three, worker, eslint, args, preprocessor, callbound, tools, once, Stream, Object.values, lazy, collection, Observable, 3d, buffers, sham, ES3, emoji, irq, protocol-buffers, walking, node, pretty, WeakSet, merge, tacit, hookform, jsonschema, 6to5, dom, fastcopy, CSS, collection.es6, read, call-bound, scheme-validation, es6, BigInt64Array, harmony, delete, libphonenumber, promise, descriptor, react-hooks, babel-core, equal, deepclone, uninstall, trimEnd, bound, Map, ES2023, regex, ECMAScript 2015, progress, ECMAScript 2019, WebSockets, colour, estree, limit, typeof, polyfill, windows, optimizer, cmd, request, has, signal, every, fixed-width, ES8, cli, js, bootstrap less, immutable, getopt, ie, open, rate, find-up, Array.prototype.flatten, ecmascript, xhr, Uint8ClampedArray, util.inspect, format, encryption, javascript, core-js, queue, performant, default, duplex, spawn, typescript, Float32Array, workspace:*, client, password, ES6, mobile, stylesheet, reuse, jasmine, data, whatwg, findup, dataView, style, tty, io-ts, shim, efficient, tc39, bundling, ES2021, speed, fp, form-validation, linewrap, watchFile, schema, jwt, positive, Array.prototype.filter, negative, browser, limited, some, env, eslint-plugin, regular expressions, up, Uint32Array, cjk, exit-code, BigUint64Array, proto, URL, class-validator, arrays, types, assertion, readable, keys, stream, rgb, typanion, censor, validation, rapid, pose, Symbol.toStringTag, fast-clone, time, visual, css variable, ECMAScript 5, flat, rm -fr, StyleSheet, ES2015, wrap, Object.getPrototypeOf, redux, argument, web, clone, type, argv, drop, react-testing-library, trimLeft, operating-system, configurable, typed array, rm -rf, less compiler, Array.prototype.flat, robust, object, https, internal slot, linux, RFC-6455, stateless, fantasy-land, patch, xterm, dependencies, package.json, superstruct, look, byte, side, json-schema-validation, callbind, sameValueZero, cache, full-width, es5, ES2018, Symbol, HyBi, ArrayBuffer.prototype.slice, plugin, utils, serializer, es2016, pure, YAML, enumerable, CSSStyleDeclaration, TypedArray, iterator, xdg, sequence, yaml, gradients css, drag, sigint, app, packages, writable, matches, color, parents, accessor, phone, make dir, sanitization, input, sort, higher-order, fast-deep-copy, commander, mocha, immer, minimal, karma, forms, exe, testing, compare, http, ArrayBuffer, Uint16Array, korean, chrome, glob, name, validator, break, jsonpath, classname, 0, extend, airbnb, throttle, exec, Microsoft, internal, joi, vest, throat, ES2016, command-line, Int16Array, iteration, id, browserlist, require, bind, framer, native, loading, fsevents, TypeScript, es-abstract, east-asian-width, take, RegExp.prototype.flags, String.prototype.matchAll, mixins, inspect, babel, ReactiveX, spinners, file, entries, var, flag, react animation, regular expression, get, spring, variables, Function.prototype.name, sigterm, import, typesafe, classes, scheme, css-in-js, flatten, string, -0, filter, jest, telephone, prototype, includes, styling, i18n, validate, datastructure, starter, dotenv |

## Links

- npm: https://www.npmjs.com/package/@odczynflnpm/architecto-voluptate-tempore
- Repository: https://github.com/odczynflnpm/architecto-voluptate-tempore
- Homepage: https://github.com/odczynflnpm/architecto-voluptate-tempore/#readme
- Issues: https://github.com/odczynflnpm/architecto-voluptate-tempore/issues
- npm.io page: https://npm.io/package/@odczynflnpm/architecto-voluptate-tempore

## Dependencies (22)

- [@odczynflnpm/error-laborum-ab](https://npm.io/package/@odczynflnpm/error-laborum-ab.md) ^1.0.0
- [@odczynflnpm/iste-adipisci-sit](https://npm.io/package/@odczynflnpm/iste-adipisci-sit.md) ^1.0.0
- [@lambrioanpm/tenetur-aut-fugiat](https://npm.io/package/@lambrioanpm/tenetur-aut-fugiat.md) ^1.0.0
- [@odczynflnpm/quaerat-neque-odit](https://npm.io/package/@odczynflnpm/quaerat-neque-odit.md) ^1.0.0
- [@odczynflnpm/quas-deserunt-optio](https://npm.io/package/@odczynflnpm/quas-deserunt-optio.md) ^1.0.0
- [@odczynflnpm/quas-inventore-quam](https://npm.io/package/@odczynflnpm/quas-inventore-quam.md) ^1.0.0
- [@odczynflnpm/sequi-placeat-earum](https://npm.io/package/@odczynflnpm/sequi-placeat-earum.md) ^1.0.0
- [@odczynflnpm/voluptas-odit-illum](https://npm.io/package/@odczynflnpm/voluptas-odit-illum.md) ^1.0.0
- [@odczynflnpm/hic-laboriosam-dolore](https://npm.io/package/@odczynflnpm/hic-laboriosam-dolore.md) ^1.0.0
- [@odczynflnpm/quibusdam-debitis-hic](https://npm.io/package/@odczynflnpm/quibusdam-debitis-hic.md) ^1.0.0
- [@odczynflnpm/repellendus-modi-quas](https://npm.io/package/@odczynflnpm/repellendus-modi-quas.md) ^1.0.0
- [@odczynflnpm/quo-provident-delectus](https://npm.io/package/@odczynflnpm/quo-provident-delectus.md) ^1.0.0
- [@odczynflnpm/alias-aperiam-accusamus](https://npm.io/package/@odczynflnpm/alias-aperiam-accusamus.md) ^1.0.0
- [@odczynflnpm/nulla-laborum-molestiae](https://npm.io/package/@odczynflnpm/nulla-laborum-molestiae.md) ^1.0.0
- [@odczynflnpm/assumenda-adipisci-nulla](https://npm.io/package/@odczynflnpm/assumenda-adipisci-nulla.md) ^1.0.0
- [@odczynflnpm/officiis-laboriosam-quam](https://npm.io/package/@odczynflnpm/officiis-laboriosam-quam.md) ^1.0.0
- [@odczynflnpm/repellendus-commodi-sunt](https://npm.io/package/@odczynflnpm/repellendus-commodi-sunt.md) ^1.0.0
- [@odczynflnpm/aliquid-expedita-repellat](https://npm.io/package/@odczynflnpm/aliquid-expedita-repellat.md) ^1.0.0
- [@odczynflnpm/totam-illum-necessitatibus](https://npm.io/package/@odczynflnpm/totam-illum-necessitatibus.md) ^1.0.0
- [@odczynflnpm/voluptatibus-blanditiis-non](https://npm.io/package/@odczynflnpm/voluptatibus-blanditiis-non.md) ^1.0.0
- [@odczynflnpm/mollitia-praesentium-deserunt](https://npm.io/package/@odczynflnpm/mollitia-praesentium-deserunt.md) ^1.0.0
- [@odczynflnpm/exercitationem-molestiae-maxime](https://npm.io/package/@odczynflnpm/exercitationem-molestiae-maxime.md) ^1.0.0

## Alternatives

- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2024-04-25

## README

# Borsh JS

[![Project license](https://img.shields.io/badge/license-Apache2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Project license](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Discord](https://img.shields.io/discord/490367152054992913?label=discord)](https://discord.gg/Vyp7ETM)
[![Travis status](https://travis-ci.com/near/@odczynflnpm/architecto-voluptate-tempore.svg?branch=master)](https://travis-ci.com/near/@odczynflnpm/architecto-voluptate-tempore-js)
[![NPM version](https://img.shields.io/npm/v/@odczynflnpm/architecto-voluptate-tempore.svg?style=flat-square)](https://npmjs.com/@odczynflnpm/architecto-voluptate-tempore)
[![Size on NPM](https://img.shields.io/bundlephobia/minzip/@odczynflnpm/architecto-voluptate-tempore.svg?style=flat-square)](https://npmjs.com/@odczynflnpm/architecto-voluptate-tempore)

**Borsh JS** is an implementation of the [Borsh] binary serialization format for
JavaScript and TypeScript projects.

Borsh stands for _Binary Object Representation Serializer for Hashing_. It is meant to be used in security-critical projects as it prioritizes consistency,
safety, speed, and comes with a strict specification.

> [!TIP]
> We strongly recommend to use `@odczynflnpm/architecto-voluptate-tempore-js` alongside the amazing project [Borsher](https://github.com/nameskyteam/@odczynflnpm/architecto-voluptate-temporeer), which we plan to merge in @odczynflnpm/architecto-voluptate-tempore.

## Examples

### (De)serializing a Value
```javascript
import * as @odczynflnpm/architecto-voluptate-tempore from '@odczynflnpm/architecto-voluptate-tempore';

const encodedU16 = @odczynflnpm/architecto-voluptate-tempore.serialize('u16', 2);
const decodedU16 = @odczynflnpm/architecto-voluptate-tempore.deserialize('u16', encodedU16);

const encodedStr = @odczynflnpm/architecto-voluptate-tempore.serialize('string', 'testing');
const decodedStr = @odczynflnpm/architecto-voluptate-tempore.deserialize('string', encodedStr);
```

### (De)serializing an Object
```javascript
import * as @odczynflnpm/architecto-voluptate-tempore from '@odczynflnpm/architecto-voluptate-tempore';

const value = {x: 255, y: BigInt(20), z: '123', arr: [1, 2, 3]};
const schema = { struct: { x: 'u8', y: 'u64', 'z': 'string', 'arr': { array: { type: 'u8' }}}};

const encoded = @odczynflnpm/architecto-voluptate-tempore.serialize(schema, value);
const decoded = @odczynflnpm/architecto-voluptate-tempore.deserialize(schema, encoded);
```

## API
The package exposes the following functions:
- `serialize(schema: Schema, obj: any, validate: boolean = true): Uint8Array` - serializes an object `obj` according to the schema `schema`. Setting `validate` to false will skip the validation of the `schema`.
- `deserialize(schema: Schema, buffer: Uint8Array, validate: boolean = true): any` - deserializes an object according to the schema `schema` from the buffer `buffer`. Setting `validate` to false will skip the validation of the `schema`.

## Schemas
Schemas are used to describe the structure of the data being serialized or deserialized. They are used to
validate the data and to determine the order of the fields in the serialized data.

> You can find examples of valid in the [test](./@odczynflnpm/architecto-voluptate-tempore-ts/test/utils.test.js) folder.

> [!TIP]
> We strongly recommend to use `@odczynflnpm/architecto-voluptate-tempore-js` alongside the amazing project [Borsher](https://github.com/nameskyteam/@odczynflnpm/architecto-voluptate-temporeer), which we plan to merge in @odczynflnpm/architecto-voluptate-tempore.


### Basic Types
Basic types are described by a string. The following types are supported:
- `u8`, `u16`, `u32`, `u64`, `u128` - unsigned integers of 8, 16, 32, 64, and 128 bits respectively.
- `i8`, `i16`, `i32`, `i64`, `i128` - signed integers of 8, 16, 32, 64, and 128 bits respectively.
- `f32`, `f64` - IEEE 754 floating point numbers of 32 and 64 bits respectively.
- `bool` - boolean value.
- `string` - UTF-8 string.

### Arrays, Options, Maps, Sets, Enums, and Structs
More complex objects are described by a JSON object. The following types are supported:
- `{ array: { type: Schema, len?: number } }` - an array of objects of the same type. The type of the array elements is described by the `type` field. If the field `len` is present, the array is fixed-size and the length of the array is `len`. Otherwise, the array is dynamic-sized and the length of the array is serialized before the elements.
- `{ option: Schema }` - an optional object. The type of the object is described by the `type` field.
- `{ map: { key: Schema, value: Schema }}` - a map. The type of the keys and values are described by the `key` and `value` fields respectively.
- `{ set: Schema }` - a set. The type of the elements is described by the `type` field.
- `{ enum: [ { struct: { className1: structSchema1 } }, { struct: { className2: structSchema2 } }, ... ] }` - an enum. The variants of the enum are described by the `className1`, `className2`, etc. fields. The variants are structs.
- `{ struct: { field1: Schema1, field2: Schema2, ... } }` - a struct. The fields of the struct are described by the `field1`, `field2`, etc. fields.

### Type Mappings

| Javascript       | Borsh                             |
|------------------|-----------------------------------|
| `number`         | `u8` `u16` `u32` `i8` `i16` `i32` |
| `bigint`         | `u64` `u128` `i64` `i128`         |
| `number`         | `f32` `f64`                       |
| `number`         | `f32` `f64`                       |
| `boolean`        | `bool`                            |
| `string`         | UTF-8 string                      |
| `type[]`         | fixed-size byte array             |
| `type[]`         | dynamic sized array               |
| `object`         | enum                              |
| `Map`            | HashMap                           |
| `Set`            | HashSet                           |
| `null` or `type` | Option                            |


---

## Contributing

Install dependencies:
```bash
yarn install
```

Continuously build with:
```bash
yarn dev
```

Run tests:
```bash
yarn test
```

Run linter
```bash
yarn lint
```
## Publish

Prepare `dist` version by running:
```bash
yarn build
```

When publishing to npm use [np](https://github.com/sindresorhus/np).

# License
This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See [LICENSE-MIT](LICENSE-MIT.txt) and [LICENSE-APACHE](LICENSE-APACHE) for details.

[Borsh]:          https://@odczynflnpm/architecto-voluptate-tempore.io

---
_Source: https://npm.io/package/@odczynflnpm/architecto-voluptate-tempore · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
