Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
datafactory
Advanced tools
Readme
A lightweight node package for creating test data, demo data and fixtures.
import DataFactory from 'datafactory';
let demoData = new DataFactory({
organization: {
_id: randomId(),
name: 'Example organization'
},
user: {
_id: randomId(),
name: 'Joe Smith',
// Assign the user to the first organization in the group by default
organizationId: (group) => {
const organizations = group.data.organization;
if (organizations) return organization[0]._id;
}
},
tweet: (group) => {
const tweet = { _id: randomId(), text: 'Hi!' };
// Assign the tweet to the first user in the group by default
if (group.data.user) {
tweet.userId = group.data.user[0]._id;
}
return tweet;
})
});
export function generateDemoData() {
let group = demoData.createGroup();
// Generate an organization, a user for the organization, and a tweet for the user.
group.organization().user().tweet({ text: '@Elisabeth cool demo data!' });
// Create another user and a tweet for them
let elisabeth = group.user({ name: 'Elisabeth' });
group.tweet({ userId: elisabeth._id, text: '@Joe Thanks!' });
console.log('Generated documents', group.data);
}
Follow the airbnb styleguide.
I recommend setting up the babel
and eslint
plugins for sublime.
Requires node ^5.0.0
.
npm install
npm run production
- Build task that generates minified scripts for productionnpm run precommit
- Run the unit tests and generate a minified scriptnpm run clean
- Remove the dist
foldernpm run eslint:source
- Lint the sourcenpm run eslint:common
- Lint the unit tests shared by Karma and Mochanpm run clean
- Remove the coverage report and the dist foldernpm run test
- Runs unit tests for both server and the browsernpm run test:browser
- Runs the unit tests for browser / clientnpm run test:server
- Runs the unit tests on the servernpm run watch:server
- Run all unit tests for server & watch files for changesnpm run watch:browser
- Run all unit tests for browser & watch files for changesnpm run karma:firefox
- Run all unit tests with Karma & Firefoxnpm run karma:chrome
- Run all unit tests with Karma & Chromenpm run packages
- List installed packagesnpm run package:purge
- Remove all dependenciesnpm run package:reinstall
- Reinstall all dependenciesnpm run package:updates
- shows a list over dependencies with a higher version number then the current one - if anynpm run package:upgrade
- Automaticly upgrade all dependencies and update package.jsonThank you @kflash for trolly the skeleton this project was started with.
MIT © Dispatch
FAQs
A lightweight node package for creating test / demo data and fixtures.
We found that datafactory 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.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).