Socket
Socket
Sign inDemoInstall

json-api-shop

Package Overview
Dependencies
74
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    json-api-shop

Javascript based tools for building applications based on json:api specification and conventions


Version published
Weekly downloads
34
decreased by-43.33%
Maintainers
1
Install size
3.11 MB
Created
Weekly downloads
 

Readme

Source

json:api shop

Build Status NPM Status

Documentation

Browse documentation pages.

About

Javascript based tools for building applications based on JSON:API specification and conventions.

Who is it for

  • backend javascript developer invested in JSON:API standard looking to streamline api development and enforce conventions and practices defined in specification
  • frontend developer who works with JSON:API powered api backend and needs a quick way to bootstrap mocked api backend for prototyping and running test suites

What is included

  • adapter for "in memory" database storage
  • service api to query and represent resources from storage
  • express server to expose resource operations via http api
  • browser server for prototypes and test runners

What it does

  • Request validation. JSON:API specification defines how resources are queried and manipulated. If a client request is malformed (invalid relationship payload, missing resource type or id, invalid query parameters...) bundled tools will ensure that it never reaches your application logic and will report bad requests back to client.

  • JSON:API resource representation with included resources. Building included resources payload can be daunting task involving recursion, sub queries, memoization and other techniques. Here this work is done automatically with no configuration or development effort needed.

  • Sparse fieldsets and relationship includes. No config needed here too. Clients can request smaller resource payloads using sparse fieldsets and relationship includes leaving your server and application logic with less sub-queries and work in general. This type of response / logic trimming is also done automatically.

  • HTTP server to present and manipulate your resources via api. Express node.js server comes bundled and preconfigured with all route and error handlers.

  • Browser server to prototype apps or mock api endpoints in test suits. Included browser based server intercepts XMLHttpRequest and Fetch requests and pulls a trick on your frontend api handlers. Your mocked dataset lives in browser memory and can even be persisted in browser storage (local storage, session storage...). Serverlesss. Kind of.

What it does not do

  • Authentication and authorization.
  • Database and resource modeling
  • Query caching

What you need to do

  • Create simple resource schema for your resource models.
  • Choose database engine (process memory, file, SQLite, MySQL, PostgreSQL, Firebase, Firestore, Mongo, Redis...) for your resources and implement database adapter.
  • Choose how you want to expose your resources - via simple programmatic service api, express or browser server.

Documentation and demo

Browse documentation pages.

Keywords

FAQs

Last updated on 22 Jul 2020

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc