Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
json-api-response-converter
Advanced tools
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/guillaumebriday) [![](https://img.shields.io/npm/dt/json-api-response-converter.svg)](https://www.npmjs.com/package/json-api-response-converter) [![](https://img.shiel
$ npm install json-api-response-converter --save
# or
$ yarn add json-api-response-converter
import JsonApiResponseConverter from 'json-api-response-converter'
const response = {
data: [
{
id: '1',
type: 'articles',
attributes: {
title: 'This project is awesome'
},
relationships: {
author: {
data: { id: '1', type: 'author' }
},
comments: {
data: [
{ id: '1', type: 'comment' },
{ id: '2', type: 'comment' }
]
}
}
}
],
included: [
{
id: '1',
type: 'author',
attributes: {
name: 'Anakin'
}
},
{
id: '1',
type: 'comment',
attributes: {
body: 'First!'
}
},
{
id: '2',
type: 'comment',
attributes: {
body: 'Second!'
}
}
]
}
const data = new JsonApiResponseConverter(response).formattedResponse
console.log(data)
/**
[
{
id: 1,
title: 'This project is awesome',
author: {
id: 1,
name: 'Anakin'
},
comments: [
{
id: 1,
body: 'First!'
},
{
id: 2,
body: 'Second!'
}
]
}
]
*/
Many edges cases are tested in the tests folder
$ git clone https://github.com/guillaumebriday/json-api-response-converter
$ cd json-api-response-converter
$ yarn # or npm install
You can run tests with Jest:
$ yarn test # or npm run test
Check the syntax with ESLint:
$ yarn lint
Do not hesitate to contribute to the project by adapting or adding features ! Bug reports or pull requests are welcome.
Inspired by:
The gem is available as open source under the terms of the MIT License.
FAQs
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/guillaumebriday) [![](https://img.shields.io/npm/dt/json-api-response-converter.svg)](https://www.npmjs.com/package/json-api-response-converter) [![](https://img.shiel
We found that json-api-response-converter 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.