Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-faker

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-faker

Include fake data in your app for testing or prototyping.

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
854
decreased by-55.36%
Maintainers
2
Weekly downloads
 
Created
Source

Ember Faker

Build Status

Ember addon wrapper for Faker.js.

Installation for ember-cli >= 0.2.3

ember install ember-faker
ember-cli 0.1.5 - 0.2.2
ember install:addon ember-faker

Usage

Import the faker module with import faker from 'faker'. Then you can use it as a default value for dummy data:

import faker from 'faker';

export default DS.Model.extend({
  firstName: DS.attr('string', {
    defaultValue: function() {
      return faker.name.firstName();
    }
  })
});

Or manually set attributes for tests or prototypes:

import faker from 'faker';

// ...

user.set('firstName', faker.name.firstName());
user.set('lastName', faker.name.lastName());

Environment options

By default faker is included into your build for non-production environments. To include it in production, add this to your config:

// ember-cli-build.js
let app = new EmberApp(defaults, {
  'ember-faker': {
    enabled: EmberApp.env === 'production'
  }
});

Development

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.

License

MIT

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Thanks to the following

Crafted with <3 by John Otander (@4lpine).

Keywords

FAQs

Package last updated on 26 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc