social-network-mock

0.0.2 • Public • Published

social-network-mock

j-mendez

Rapidly bootstrap your next project with mock data to replicate a social network. Easily drop it in and replace it as your API grows.

Getting Started

  1. npm install social-network-mock --save

How to use

Utils Params Info
generateSocialNetwork(size, currentUser) size: 10, currentUser: null generate a collection of data for a social network mock
generateRandomUsers(size, hobbies) size: 10, hobbies: null generate a list of random users with hobbie collection sync
generateRandomHobbies() none generate a list of random hobbies
generateRandomHobbie() none generate a random hobbie
generateRandomString() none generate a random string

Example

import {
  generateSocialNetwork,
  HobbieExperience,
  HobbieType,
  UserModel,
} from "social-network-mock";

const me = new UserModel(
  { firstName: "Bob", middleName: "Adam", lastName: "Johns", suffix: ".SR" },
  [
    {
      exp: HobbieExperience.Beginner,
      type: HobbieType.Biking,
    },
  ]
);

const {
  usersCollection,
  hobbiesCollection,
  followersCollection,
} = generateSocialNetwork(1000, me);

Readme

Keywords

none

Package Sidebar

Install

npm i social-network-mock

Weekly Downloads

3

Version

0.0.2

License

MIT

Unpacked Size

53.7 kB

Total Files

71

Last publish

Collaborators

  • jeffmendez