Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@fluentfixture/core
Advanced tools
A flexible tool for generating customizable mock data with fluent interface.
A flexible tool for generating customizable mock data with a fluent interface that is a part of @fluentfixture project.
A flexible tool for generating customizable mock data with a fluent interface that is a part of the @fluentfixture project. Provides core modules and components for generating mock data.
$ npm install @fluentfixture/core
import { alphabetic, bool, hex, int, obj, pick } from '@fluentfixture/core';
// Defines a price generator with amount and the currency fields.
const price = obj({
amount: int(1, 100), // generates an integer between 1 and 100
currency: pick(['USD', 'EUR', 'GBP', 'TRY']), // picks one of them
});
// Defines a color generator. (hex + pad + uppercase)
const color = hex(6).padStart(7, '#').upperCase();
// Defines a product generator.
const product = obj({
id: int(1, 999), // generates an integer between 1 and 999
name: alphabetic(20).capitalCase(), // generates a name with capital case
color: color, // generates color by using the color generator
price: price, // generates price by using the price generator
discount: price.optional(), // generates price by using the price generator or undefined
featured: bool(0.7), // generates a boolean that mostly true
});
// Introduces the 'code' field using the previously generated id and the color.
// By doing this, all mock products are consistent within themselves.
const productWithCode = product
.lazy('code', (p) => `${p.id}-${p.color}`);
// Converts productWithCode generator to an array and sort them by using the id field.
const products = productWithCode
.array(10)
.sort((a, b) => a.id - b.id);
// Executes the model.
console.log(products.single());
To check out the guide, visit https://docs.fluentfixture.com/
@fluentfixture is MIT licensed.
FAQs
A flexible tool for generating customizable mock data with fluent interface.
We found that @fluentfixture/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.