Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bigstickcarpet/mock-data

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bigstickcarpet/mock-data

Mock data for sample apps, demos, and POCs

  • 3.0.11
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Mock Data

Mock data for sample apps, demos, and POCs

Build Status Dependencies Coverage Status Inline docs

npm Bower License

Browser Compatibility

Features

  • No dependencies
  • Tested in Node, IO.js, and all modern web browsers on Mac, Windows, Linux, iOS, and Android
  • 100 mock employees, with names, addresses, phone numbers, etc.
  • 100 mock projects, with names, dates, departments, employees assigned, etc.
  • Full-size and thumbnail photos for each employee
  • All data follows logical rules:
    • Usernames, SSNs, addresses, etc. are unique
    • Birthdates, hire dates, and termination dates are in proper chronological order
    • Employee roles "make sense" (e.g. "full time" and "part time" are mutually exclusive)
    • Employees are only assigned to projects in their own department
    • Employees are only assigned to projects that occurred during their employment

Installation & Usage

Node

Install via NPM:

npm install @bigstickcarpet/mock-data

The mock data can be used as plain JSON or as JavaScript arrays of objects.

Raw JSON
var employeeJSON = require('@bigstickcarpet/mock-data/employees.json');
employeeJSON.forEach(function(employee) {
  console.log(employee.dob);    // string (in ISO 8601 zulu format)
});
JavaScript Objects
var mockData = require('@bigstickcarpet/mock-data');
mockData.employees.forEach(function(employee) {
  console.log(employee.dob);    // Date object
});

Web Browsers

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.

Raw JSON
$.getJSON("bower_components/mock-data/employees.json", function(employeeJSON) {
  employeeJSON.forEach(function(employee) {
    console.log(employee.dob);    // string (in ISO 8601 zulu format)
  });
});
JavaScript Objects
<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>

Employees

mockData.employees is an array of objects with the following properties:

PropertyData TypeDescription
usernamestringA alphanumeric username that is unique for each employee
passwordstringAn alphanumeric password
name.firststringFirst name
name.laststringLast name
genderstring"male" or "female"
portraitstringThe path of the full-size portrait photo
thumbnailstringThe path of the thumbnail-size portrait photo
emailstringEmail address
address.streetstringHouse number and street name
address.citystringCity name
address.statestringU.S. state name (full name, not abbreviation)
address.zipstringU.S. zip code, in the format #####
phonesarray of objectsArray of phone objects
phones[].typestring"home", "office", or "cell"
phones[].numberstringPhone number, in the format ###-##-####
ssnstringU.S. Social Security Number, in the format ###-##-####. Unique for each employee.
dobDateDate of birth
hiredOnDateDate the employee was hired
terminatedOnDate or nullDate the employee was terminated, or null if still employed
departmentstring"Accounting", "Sales", "Human Resources", or "Marketing"
rolesarray of stringsArray of roles, such as "employee", "consultant", "part time", etc.

Projects

mockData.projects is an array of objects with the following properties:

PropertyData TypeDescription
idnumberNumeric ID that is unique for each project
namestringProject name that is unique for each project. 55 characters max.
descriptionstringLong project description. 2000 characters max
departmentstring"Accounting", "Sales", "Human Resources", or "Marketing"
startedOnDateDate that the project started
endedOnDate or nullDate that the project ended, or null if still ongoing
assignedarray of stringsArray of usernames of employees who are assigned to the project. Projects will only have employees from the same department.

License

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.

Keywords

FAQs

Package last updated on 14 Aug 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc