Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@bigstickcarpet/mock-data
Advanced tools
Install via NPM:
npm install @bigstickcarpet/mock-data
The mock data can be used as plain JSON or as JavaScript arrays of objects.
var employeeJSON = require('@bigstickcarpet/mock-data/employees.json');
employeeJSON.forEach(function(employee) {
console.log(employee.dob); // string (in ISO 8601 zulu format)
});
var mockData = require('@bigstickcarpet/mock-data');
mockData.employees.forEach(function(employee) {
console.log(employee.dob); // Date object
});
Install via Bower:
bower install mock-data
The mock data can be used as plain JSON (via jQuery.getJSON()
) or as JavaScript arrays of objects.
$.getJSON("bower_components/mock-data/employees.json", function(employeeJSON) {
employeeJSON.forEach(function(employee) {
console.log(employee.dob); // string (in ISO 8601 zulu format)
});
});
<script src="bower_components/mock-data/dist/mock-data.min.js"></script>
<script>
mock.data.employees.forEach(function(employee) {
console.log(employee.dob); // Date object
});
</script>
mockData.employees
is an array of objects with the following properties:
Property | Data Type | Description |
---|---|---|
username | string | A alphanumeric username that is unique for each employee |
password | string | An alphanumeric password |
name.first | string | First name |
name.last | string | Last name |
gender | string | "male" or "female" |
portrait | string | The path of the full-size portrait photo |
thumbnail | string | The path of the thumbnail-size portrait photo |
email | string | Email address |
address.street | string | House number and street name |
address.city | string | City name |
address.state | string | U.S. state name (full name, not abbreviation) |
address.zip | string | U.S. zip code, in the format ##### |
phones | array of objects | Array of phone objects |
phones[].type | string | "home", "office", or "cell" |
phones[].number | string | Phone number, in the format ###-##-#### |
ssn | string | U.S. Social Security Number, in the format ###-##-####. Unique for each employee. |
dob | Date | Date of birth |
hiredOn | Date | Date the employee was hired |
terminatedOn | Date or null | Date the employee was terminated, or null if still employed |
department | string | "Accounting", "Sales", "Human Resources", or "Marketing" |
roles | array of strings | Array of roles, such as "employee", "consultant", "part time", etc. |
mockData.projects
is an array of objects with the following properties:
Property | Data Type | Description |
---|---|---|
id | number | Numeric ID that is unique for each project |
name | string | Project name that is unique for each project. 55 characters max. |
description | string | Long project description. 2000 characters max |
department | string | "Accounting", "Sales", "Human Resources", or "Marketing" |
startedOn | Date | Date that the project started |
endedOn | Date or null | Date that the project ended, or null if still ongoing |
assigned | array of strings | Array of usernames of employees who are assigned to the project. Projects will only have employees from the same department. |
All JSON data is MIT licensed and can be used however you want.
All images (employee portraits) are licensed under Creative Commons BY-NC-SA 4.0 and have some limitations on their use.
See the LICENSE file for more details.
FAQs
Mock data for sample apps, demos, and POCs
We found that @bigstickcarpet/mock-data 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.