
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
This is a quick and simple standalone data mocking package. Provide the method with the structure of the object / type you would like mocked and the resulting amount to mock.
npm:
npm i toss-me-a
yarn:
yarn add toss-me-a
This package exports a default method tossMeA. Provide this method an object to mock, and a count of how many to return (default 1 if omitted).
| Type | Options | Example | Description |
|---|---|---|---|
| string | 'string-[length]-[formatted]' | 'string-15-f' | Get a string of specified length with optional spacing formatting f (default 10, non-formatted) |
| number | 'number-[min]-[max]' | 'number-0-50' | Get an integer number between min/max values (default 0-100) |
| boolean | N/A | 'boolean' | Get a boolean value |
| date | 'date-[start epoch]-[end epoch]' | 'date-1604102400000-1635638400000' | Get a random date between a start and end date (epoch) (default is between epoch 0 and current date) |
| array | ['[type]', [amount]] | ['string', 5] | Get an array containing the amount of type provided |
| function | N/A | () => generateId() | Provide a funciton as the value to perform the function and return the value to the resulting object |
| object | N/A | {aString: 'string'} | Provide an object of the same mock structure to recursively create mock data |
import tossMeA from 'toss-me-a'
tossMeA(
{
// Provide a function to be executed and the value returned into the mock data
id: () => generateAnId(),
// Anything provided that is not a string|function|object will be included as is
aConst: 15,
// Use a function to provide a constant value to the mock data
anotherConst: () => 'always-this-string',
aString: 'string',
aStringLength15: 'string-15',
// String 100 characters long with spacing
aStringFormatted: 'string-100-f',
// Get a date between epoch 0 and current date
aDate: 'date',
// Get a date between Oct-31-2020 and Oct-31-2021
aSpecificDate: 'date-1604102400000-1635638400000',
// Array of type
arrayOfStrings: ['string', 4],
aNumber: 'number-0-5',
aBoolean: 'boolean',
category: {
// Nested object recursively generates data
anotherString: 'string',
anotherObject: {
anotherArray: ['number-0-10', 3]
}
}
},
10 // How many of these objects to return
)
MIT (See license file)
FAQs
Tiny and simple package to mock data
The npm package toss-me-a receives a total of 0 weekly downloads. As such, toss-me-a popularity was classified as not popular.
We found that toss-me-a 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.