2.0.1 • Published 2 years ago

ember-faker v2.0.1

Weekly downloads
4,007
License
MIT
Repository
github
Last release
2 years ago

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

2.0.1

2 years ago

2.0.0

3 years ago

1.6.0

4 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.2

7 years ago

1.1.1

8 years ago

1.1.0

9 years ago

1.0.0

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago