Coder Social home page Coder Social logo

ember-faker's Introduction

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

ember-faker's People

Contributors

brendenpalmer avatar ember-tomster avatar johno avatar kidgodzilla avatar nlfurniss avatar prio101 avatar samselikoff avatar spieker avatar yoranbrondsema avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ember-faker's Issues

Deprecation on ember-cli 2.12

When used with [email protected], ember-faker emits the following deprecation warning:

DEPRECATION: Addon files were detected in /path/to/app/node_modules/ember-faker/addon, but no JavaScript preprocessors were found for ember-faker. Please make sure to add a preprocessor (most likely ember-cli-babel) to in dependencies (NOT devDependencies) in ember-faker's package.json.

stop using Bower?

From #12, I saw a lot of discussion around not relying on bower for the Faker dependency. Figured it might be worth opening an issue specific to that.

Faker initializer in production builds

There is initializer inlcuded in production builds when faker is disabled in config/environment 'ember-cli-faker': {enabled:false}. Why is the initializer app/initializer here anyway? it is empty.

Bump faker to 3.1.0

Currently version seems to be "Faker": "~2.1.0" which is missing count for faker.random.alphaNumberic :(

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.