How to use the faker.company function in faker

To help you get started, we’ve selected a few faker 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 letterpad / letterpad / src / api / seed / seed.js View on Github external
export async function insertPost(params, models, categories, tags) {
  // get author  // 1 or 2
  const randomAuthorId = Math.floor(Math.random() * (2 - 1 + 1)) + 1;
  let admin = await models.Author.findOne({ where: { id: randomAuthorId } });
  const slug = params.title.toLocaleLowerCase().replace(/ /g, "-");
  let post = await models.Post.create({
    title: Faker.company.catchPhrase(),
    body: generatePost(),
    excerpt: Faker.lorem.sentences(4),
    cover_image: params.cover_image,
    authorId: randomAuthorId,
    type: params.type,
    status: params.status,
    slug: slug,
    createdAt: new Date(),
    publishedAt: new Date(),
  });

  const randomCategory = Math.floor(Math.random() * (2 - 1 + 1)) + 1;

  return Promise.all([
    admin.addPost(post),
    post.addTaxonomy(categories[randomCategory]),
github deanius / rx-helper / demos / 04-batched-write.js View on Github external
completed.complete()
    }
  }

  // Now set up the renderer, and process
  const renderer = writeToFile
  antares.addRenderer(writeToFile, {
    name: "fileWriter",
    xform
  })

  for (let i = 0; i < count; i++) {
    antares.process({
      type: "writeIt",
      payload: {
        text: faker.company.catchPhrase()
      },
      meta: { index: i }
    })
  }

  // Force jest to wait for us!
  return completed.toPromise()
}
github rationalappdev / react-native-horizontal-calendar-tutorial / App.js View on Github external
return [...new Array(64)].map(_ => ({
    date: startDay.add(4, 'hours').clone(),
    title: faker.company.companyName(),
    description: faker.lorem.sentence(),
    // use random dimensions to get random urls
    image: faker.image.nightlife(Math.floor(Math.random() * 200) + 100, Math.floor(Math.random() * 200) + 100),
  }));
})();
github hql287 / Manta / app / helpers / __tests__ / form.spec.js View on Github external
beforeEach(() => {
    formData = {
      invoiceID: 'Invoice: 123-456-789',
      recipient: {
        newRecipient: true,
        select: {
          id: uuidv4(),
          fullname: faker.name.findName(),
          email: faker.internet.email(),
          company: faker.company.companyName(),
          phone: faker.phone.phoneNumber(),
        },
        new: {
          fullname: faker.name.findName(),
          email: faker.internet.email(),
        },
      },
      rows: [
        {
          id: uuidv4(),
          description: faker.commerce.productName(),
          price: faker.commerce.price(),
          quantity: faker.random.number(100),
        },
        {
          id: uuidv4(),
github withspectrum / spectrum / api / migrations / seed / generate.js View on Github external
const generateCommunity = () => {
  const name = faker.company.companyName();

  return {
    id: uuid(),
    createdAt: faker.date.past(2),
    name,
    description: casual.short_description(),
    website: faker.internet.url(),
    profilePhoto: faker.image.business(),
    coverPhoto: faker.image.image(),
    slug: slugify(name),
  };
};
github buildo / react-components / styleguide / setup.ts View on Github external
const getRandomRow = () => {
  return {
    avatar: faker.image.avatar(),
    name: faker.name.findName(),
    city: faker.address.city(),
    email: faker.internet.email(),
    company: faker.company.companyName()
  };
};
github SamHH / bukubrow-webext / src / webextension-env.ts View on Github external
.map((_, i): RemoteBookmark => ({
		id: i,
		metadata: faker.company.companyName(),
		desc: faker.company.bs(),
		url: faker.internet.url(),
		tags: ',' + [...new Set(Array(Math.floor(Math.random() * 5))
			.fill(undefined)
			.map(() => faker.random.word()))].join(',') + ',',
		flags: 0,
	}));
github freeCodeCamp / outreach-for-good / client / utils / fake-object-data-list-store.js View on Github external
createFakeRowObjectData(/*number*/ index) /*object*/ {
    return {
      id          : index,
      avatar      : faker.image.avatar(),
      city        : faker.address.city(),
      email       : faker.internet.email(),
      firstName   : faker.name.firstName(),
      lastName    : faker.name.lastName(),
      street      : faker.address.streetName(),
      zipCode     : faker.address.zipCode(),
      date        : faker.date.past(),
      bs          : faker.company.bs(),
      catchPhrase : faker.company.catchPhrase(),
      companyName : faker.company.companyName(),
      words       : faker.lorem.words(),
      sentence    : faker.lorem.sentence(),
    };
  }
github dappforce / dappforce-subsocial-ui / src / components / stories / Example.stories.tsx View on Github external
import React, { useState } from 'react';

import { withKnobs } from '@storybook/addon-knobs';
import { Menu, Icon, Button, Avatar } from 'antd';

const { SubMenu } = Menu;
import faker from 'faker';

const items = [{ avatar: faker.image.avatar(),name: faker.company.companyName() },
  { avatar: faker.image.avatar(),name: faker.company.companyName() },
  { avatar: faker.image.avatar(),name: faker.company.companyName() },
  { avatar: faker.image.avatar(),name: faker.company.companyName() },
  { avatar: faker.image.avatar(),name: faker.company.companyName() },
  { avatar: faker.image.avatar(),name: faker.company.companyName() },
  { avatar: faker.image.avatar(),name: faker.company.companyName() }];

const renderMenu = items.map((d, index) =>


<span>{d.name}</span>
);

class App extends React.Component {
  state = {
    collapsed: false
  };

  toggleCollapsed = () =&gt; {
    this.setState({