npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bigstickcarpet/mock-data

v3.0.11

Published

Mock data for sample apps, demos, and POCs

Downloads

224

Readme

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:

| 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.

Projects

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.

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.