How to use fakerator - 2 common examples

To help you get started, we’ve selected a few fakerator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vue-generators / vue-form-generator / dev / projects / full / data.js View on Github external
import Fakerator from "fakerator";
import fecha from "fecha";

let fakerator = new Fakerator();

let roles = [{ id: "admin", name: "Administrator" }, { id: "moderator", name: "Moderator" }, { id: "user", name: "Registered User" }, { id: "visitor", name: "Visitor" }];

let skills = ["HTML5", "Javascript", "CSS3", "CoffeeScript", "AngularJS", "ReactJS", "VueJS"];

let users = (function() {
	let res = [];
	for (let i = 0; i < 5; i++) {
		let lang = fakerator.random.arrayElement(["en-US", "en-GB", "de", "fr", "it"]);
		let user = fakerator.entity.user();
		user.id = i + 1;
		user.type = fakerator.random.arrayElement(["personal", "business"]);
		user.bio = fakerator.lorem.paragraph();
		let dob = fakerator.date.past(40, "1998-01-01");
		user.dob = /* fecha.format(dob, "YYYY.MM.DD");*/ dob.valueOf();
		user.time = fecha.format(new Date(), "hh:mm:ss");
github vue-generators / vue-form-generator / dev / projects / full / app.vue View on Github external
import Schema from "./schema";
import { users } from "./data";
import mixinUtils from "../../mixins/utils.js";

import Multiselect from "vue-multiselect";
Vue.component("multiselect", Multiselect);

// Test custom field
import FieldAwesome from "./fieldAwesome.vue";
Vue.component("fieldAwesome", FieldAwesome);

import { each, cloneDeep, merge } from "lodash";

Vue.use(VueFormGenerator);

let fakerator = new Fakerator();

export default {
	components: {
		DataTable
	},

	mixins: [mixinUtils],

	data() {
		return {
			isNewModel: false,

			selected: [],

			model: null,

fakerator

Random data generator with localization

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis

Popular fakerator functions