Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@holidayextras/jsonapi-client
Advanced tools
A clientside module designed to make it really easy to consume a json:api service.
A javascript module designed to make it really easy to consume a json:api
service.
!! THIS PROJECT IS NOT IN NPM !!
$ npm install --save jsonapi-client@holidayextras/jsonapi-client
note: this project requires a Node.js version of at least 4.5.0
.
Consuming a json:api service from within Javascript is a non-trivial affair. Setting up a transport mechanism, authentication, making requests to standardised HTTP routes, error handling, pagination and expanding an inclusion tree... All of these things represent barriers to consuming an API. This module takes away all the hassle and lets developers focus on interacting with a rich API without wasting developer time focusing on anything other than shipping valuable features.
This module is tested against the example json:api server provided by jsonapi-server.
<script src="/dist/jsonapi-client.min.js"></script>
<script type="text/javascript">
var client = new JsonapiClient("http://localhost:16006/rest", {
header: {
authToken: "2ad1d6f7-e1d0-480d-86b2-dfad8af4a5b3"
}
});
</script>
var JsonapiClient = require("jsonapi-client");
var client = new JsonapiClient("http://localhost:16006/rest", {
header: {
authToken: "2ad1d6f7-e1d0-480d-86b2-dfad8af4a5b3"
}
});
var article = client.create("articles");
article.set("title", "foobar");
article.sync(function(err) {
console.log("Resource created");
});
client.find("articles", function(err, resources) {
resources.map(function(resource) {
console.log(resource.toJSON());
});
});
client.get("articles", 5, { include: [ "author" ] }, function(err, article) {
console.log(article.toJSONTree());
});
article.fetch("author", function(err) {
console.log(article.author.toJSON());
});
article.relationships("comments").add(comment);
article.sync(function(err) {
console.log("Resource's relation updated");
});
article.delete(function(err) {
console.log("Resource deleted");
});
}).then(function() {
return client.create("articles")
.set("title", "some fancy booklet")
.set("content", "oh-la-la!")
.relationships("tags").add(someTagResource)
.sync();
}).then(function(newlyCreatedArticle) {
FAQs
A clientside module designed to make it really easy to consume a json:api service.
We found that @holidayextras/jsonapi-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.