Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
normal-store
Advanced tools
Utilities to transform data with unique identifiers to and from a normalized data store. All data is treated as immutable, new data structures are returned when updating.
Often when dealing with data in a single-page-application (SPA) it is useful to represent collections of resources in a way that is both easy to query and to update.
With normal-store
you can convert the resources served by your backend into a format similar to an indexed database.
const resources = [{ id: 'a' }, { id: 'b' }];
const normalized = normalize(resources); // { allKeys: ['a', 'b'], byKey: { a: { id: 'a' }, b: { id: 'b' } }}
const denormalized = denormalize(normalized); // [{ id: 'a' }, { id: 'b' }]
import axios from 'axios';
import { normalize, getOne, patchOne, removeOne } from 'normal-store';
const products = await axios.get('/products').then(res => res.data);
let productStore = normalize(products);
const decrementStock = (productID) => {
productStore = patchOne(productStore, productID, ({ stock }) => ({ stock: stock - 1 }));
};
const removeProduct = (productID) => {
productStore = removeOne(productStore, productID);
};
To use normal-store
, install it as a dependency:
# If you use npm:
npm install normal-store
# Or if you use Yarn:
yarn add normal-store
This assumes that you’re using a package manager such as npm.
FAQs
tools for interacting with normalized data structures
The npm package normal-store receives a total of 165 weekly downloads. As such, normal-store popularity was classified as not popular.
We found that normal-store 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.