A Node.js framework-agnostic library for serializing and deserializing data to JSON API 1.0 compliant format. Current stable version is 3.6.9, maintained with infrequent releases (last in 2020). Differentiators include heavy customization options (custom attribute keys via keyForAttribute, transforms, top-level links, nested relationships) and support for both serialization and deserialization. Compared to alternatives like jsonapi-store-relationaldb or fast-jsonapi, it offers more fine-grained control over meta, links, and relationship configuration.
npm install jsonapi-serializerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Serializes an article object with included author relationship to JSON API format.
Update to v3 and ensure 'type' is a string and 'ref' inside relationships points to 'id' field.
Use 'keyForAttribute: 'dash-case'' instead of 'dasherize'.
Always define 'attributes' list to control output and avoid inclusion of unintended fields.
Explicitly set 'included: false' if you do not want full inclusion.
Ensure your data structures are acyclic or use a custom transform to prune cycles.
new Serializer('resourceType', opts)Pass a valid object or array to serializer.serialize(data).
Ensure each resource object has an 'id' field, or adjust relationship 'ref' to another unique field.
Use import syntax instead: import { Serializer } from 'jsonapi-serializer'No dependency data recorded yet.