social-network-mock

social network mock for data structures in memory

Usage no npm install needed!

<script type="module">
  import socialNetworkMock from 'https://cdn.skypack.dev/social-network-mock';
</script>

README

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);