README
social-network-mock
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
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);