New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

std-json-api

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

std-json-api

JSON-API standard utilities for NestJS

Source
npmnpm
Version
1.5.0
Version published
Weekly downloads
16
6.67%
Maintainers
1
Weekly downloads
 
Created
Source

std-json-api

Functional standard JSON:API serializers, schemas, and utilities for building JSON:API compliant applications.

Types & Schemas

All types are exported from std-api. Each type has a zod schema that can be used to validate the data structure.

import type { MetaObject } from "std-json-api/std-api";
import type { metaObject } from "std-json-api/schemas/meta-object";

// validate a meta object example
metaObject.parse({});

ResourceDescriptor

A utility to describe a JSON:API resource with its attributes and relationships.

import Describe from "std-json-api/descriptor";

const desc = Describe("resource-id")
  .addAttr("name", "string")
  .addReleationship("related-resource", "related-type", "related-id")
  .build();

Functional Builder API

Provides a functional API for building JSON:API documents.

import {SingleDocument, Attributes, Meta, Resource, Id, Type} from "std-json-api/builder-fn";

const doc = SingleDocument(
    Meta({}),
    Data(
        Resource(
            Id('...'),
            Type('...'),
            Attributes({
                ...
            })
        )
    )
);

Builder API

Provides an API for building JSON:API documents.

import JsonApiBuilder from "std-json-api/builder";

const doc = JsonApiBuilder
    .singleDocument()
    .meta({})
    .data(
        JsonApiBuilder.resource()
            .id('...')
            .type('...')
            .attributes({
                ...
            })
    )

Keywords

json

FAQs

Package last updated on 27 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts