
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
@labor-digital/json-api
Advanced tools
Provides the implementation to communicate with an json api compatible endpoint
Provides the implementation to communicate with an json api compatible endpoint. The package is build with axios as http client and utilizes jsonapi-serializer to normalize the results into javascript objectes.
Install this package using npm:
npm install @labor-digital/json-api
import {JsonApiState} from "./lib/JsonApiState";
import {JsonApi} from "./lib/JsonApi";
// Create the instance
const api = new JsonApi({baseUrl: "https://example.org/api/resources"});
// Request the resources of type "myResource" that are on page 2
// The query object has some types already defined but as specified in the json-api
// definition, it can be extended with your own keys
const results = api.get("myResource", {page: {number: 2}});
// Iterate all results in the list and print the value of "myKey" into the console
results.forEach((result: JsonApiState) => {
console.log(result.get("myKey"));
});
// You can also request a single resource by using the unique id as a lookup query
const state = api.getSingle("myResource", 12);
console.log(state.get("myKey"));
The documentation / API can be found here but is also rendered at "./doc/index.html" for local usage
You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.
Our address is: LABOR.digital - Fischtorplatz 21 - 55116 Mainz, Germany
We publish all received postcards on our company website.
FAQs
Provides the implementation to communicate with an json api compatible endpoint
We found that @labor-digital/json-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.