# @codehubby/fieldscript

> FieldScript: Protect Your APIs by Easily Enforcing Type Safety in Pure JavaScript.

Latest version **1.0.4** (published 2023-05-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install @codehubby/fieldscript
pnpm add @codehubby/fieldscript
yarn add @codehubby/fieldscript
bun add @codehubby/fieldscript
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-05-15 |
| First published | 2023-05-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Neil |
| Maintainers | neil-yoga |

## Links

- npm: https://www.npmjs.com/package/@codehubby/fieldscript
- npm.io page: https://npm.io/package/@codehubby/fieldscript

## Recent versions

- 1.0.4 (latest) — 2023-05-15
- 1.0.3 — 2023-05-02
- 1.0.2 — 2023-05-02
- 1.0.1 — 2023-05-02
- 1.0.0 — 2023-05-02

## README

## FieldScript: Protect Your APIs with Type Safety in Pure JavaScript.
- 💜 Protect Your Apis
- 💜 Pure JavaScript Type Safety
- 💜 Assign Variables

A https://hub.codehubby.com package to easily Protect Your APIs by Easily Enforcing Type Safety in Pure JavaScript. Use .check({}) to batch check with variable names in error messages or use the individual methods such as stringField(), intField() and booleanField().


index.js:
```
import * as FieldScript from './FieldScript.js';
import { stringField, intField, booleanField, objectField, listField } from './FieldScript.js';

let noteObj = {title:'test','code':'test2',order:234} // remove or edit property to test

const { title,code } = FieldScript.check({
  title: () => FieldScript.stringField(noteObj.title),
  code: () => FieldScript.stringField(noteObj.code),
  order: () => FieldScript.intField(noteObj.order),
})

console.log({title, noteObj})
```

### Quick Tip to Use Import / ES6 with NodeJS:
Add this to your package.json file
```
  "type":"module",
```

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