├── .nvmrc ├── .gitignore ├── .babelrc ├── .mocharc.js ├── .eslintrc.js ├── .codecov.yml ├── .editorconfig ├── src ├── FakerGenerator.js ├── __mocks__ │ └── shims.js └── FakerDynamicValue.js ├── webpack.config.babel.js ├── LICENSE.md ├── .travis.yml ├── test ├── FakerGenerator.spec.js └── FakerDynamicValue.spec.js ├── Makefile ├── package.json ├── .github └── settings.yml └── README.md /.nvmrc: -------------------------------------------------------------------------------- 1 | lts/fermium 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | build/ 3 | coverage/ 4 | .nyc_output/ -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/env"], 3 | "plugins": ["@babel/plugin-proposal-class-properties"] 4 | } 5 | -------------------------------------------------------------------------------- /.mocharc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | require: '@babel/register', 3 | recursive: true, 4 | reporter: 'spec' 5 | } -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: 'airbnb-base', 3 | parser: 'babel-eslint', 4 | parserOptions: { 5 | ecmaVersion: 2017 6 | }, 7 | rules: { 8 | 'func-names': ['error', 'never'], 9 | 'no-confusing-arrow': [0], 10 | 'max-len': ['error', 120], 11 | 'no-eval': [0] 12 | }, 13 | env: { 14 | node: true, 15 | mocha: true 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /.codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | notify: 3 | require_ci_to_pass: true 4 | 5 | comment: 6 | behavior: default 7 | layout: header, diff 8 | require_changes: false 9 | 10 | coverage: 11 | precision: 2 12 | range: 13 | - 50.0 14 | - 80.0 15 | round: down 16 | status: 17 | changes: false 18 | patch: true 19 | project: true 20 | parsers: 21 | javascript: 22 | enable_partials: yes 23 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | end_of_line = lf 9 | insert_final_newline = true 10 | indent_style = space 11 | trim_trailing_whitespace = true 12 | 13 | [Makefile] 14 | indent_style = tab 15 | 16 | [*.js] 17 | indent_size = 2 18 | max_line_length = 120 19 | 20 | [*.{yml,json,eslintrc}] 21 | indent_size = 2 22 | 23 | [*.md] 24 | trim_trailing_whitespace = false 25 | -------------------------------------------------------------------------------- /src/FakerGenerator.js: -------------------------------------------------------------------------------- 1 | import faker from 'faker'; 2 | 3 | export default class FakerGenerator { 4 | constructor(locale, category, method, args) { 5 | this.category = category; 6 | this.method = method; 7 | this.args = args; 8 | this.faker = faker; 9 | this.faker.locale = locale; 10 | } 11 | 12 | generate() { 13 | if ( 14 | typeof this.faker[this.category] !== 'undefined' 15 | && typeof this.faker[this.category][this.method] !== 'undefined' 16 | ) { 17 | return eval(`this.faker.${this.category}.${this.method}(${this.args});`); 18 | } 19 | 20 | return ''; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/__mocks__/shims.js: -------------------------------------------------------------------------------- 1 | // This file is simply to prevent tools such as PHPStorm from complaining about undefined values 2 | if ( 3 | typeof registerDynamicValueClass === 'undefined' 4 | || typeof InputField === 'undefined' 5 | ) { 6 | class InputField { 7 | constructor(key, name, type, options, prefix = '') { 8 | this.key = key; 9 | this.name = name; 10 | this.type = type; 11 | this.options = options; 12 | this.prefix = prefix; 13 | } 14 | } 15 | 16 | module.exports = { 17 | registerDynamicValueClass: (_class) => _class, 18 | InputField, 19 | }; 20 | } else { 21 | /* eslint-disable no-undef */ 22 | module.exports = { registerDynamicValueClass, InputField }; 23 | /* eslint-enable no-undef */ 24 | } 25 | -------------------------------------------------------------------------------- /webpack.config.babel.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import UglifyPlugin from 'uglifyjs-webpack-plugin'; 3 | 4 | const production = (process.env.NODE_ENV === 'production'); 5 | 6 | module.exports = { 7 | mode: production ? 'production' : 'development', 8 | target: 'web', 9 | entry: [ 10 | 'faker', 11 | './src/FakerDynamicValue.js', 12 | ], 13 | output: { 14 | path: path.join( 15 | __dirname, 16 | './build/com.rebelinblue.PawExtensions.FakerDynamicValue', 17 | ), 18 | publicPath: '/build/', 19 | filename: 'FakerDynamicValue.js', 20 | }, 21 | module: { 22 | rules: [{ 23 | test: /\.js?$/, 24 | exclude: /(node_modules|bower_components)/, 25 | use: { 26 | loader: 'babel-loader', 27 | }, 28 | }], 29 | }, 30 | plugins: production ? [ 31 | new UglifyPlugin({ 32 | uglifyOptions: { warnings: false }, 33 | }), 34 | ] : [], 35 | }; 36 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Stephen Ball 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | os: linux 2 | dist: xenial 3 | 4 | language: node_js 5 | 6 | script: 7 | - NODE_ENV=production make build 8 | - make lint 9 | - make coverage 10 | 11 | after_success: 12 | - bash <(curl -s https://codecov.io/bash) 13 | 14 | before_deploy: 15 | - make archive 16 | 17 | deploy: 18 | provider: releases 19 | api_key: 20 | secure: bxp1e+q8HTD04T74tU6K7yfZu00wBhA2aNKvy4cLPOkQ7BQVxHLpjo9vTkL/Tom/PMAmPm5faN0YGfJc2bCUtd758aViobGJC3MPwjPKPs2dKXwjzJT9OQvSFIFzq/YbfoXy7wAS9+8wqRoPVKuwmibVeYd3Pk2A/+NYZnaBtLwbX5sddK1X2l1gee/PAtFFDPjUsbxC+f/AuNNpsSVeZKqEaCq/eCOd09/AqG49afN2f+mZARElY87u333kVLECXPyT0U8TWhDvrb8DqjehBdDaUA/3KdFlYoX8JNebZmr2RPJRso+QuAYkQFwxkNLNZHBIzi2HlCsGvmD5AsX7nnUkEnh2B8ygEXJz9I0jWhJl3uZ9DJmW84FlmVQCtRabhWAfa1+gM6u9BY1zKvnq56tXLwqbZnz87JTcbTPCyK9blqLDOf2/wM6nEomd1NLEp3o6aLKqWWi60Guw1BueWkBcaVjDX3KzQ1627Jp5/MbmvVm8PWgHh8TijodwTSWjTxDkqr2dicndvPWVpYGRu2ZDkg/W3ldwitB5b8QZKlGHKuhPyRORBZZDtRFrPEbCZXpzoMi8dpR8TXdGaJ7UTGA+LDTAGg3JpaZjZ8GYZDIWdsiNmPci4BFD2MpOtcZdcTIz/DdxTqleVlMRVdo9bhwuLNovCpIjO3GOM2EoylA= 21 | file_glob: true 22 | file: build/FakerDynamicValue-*.zip 23 | skip_cleanup: true 24 | on: 25 | tags: true 26 | all_branches: true 27 | repo: REBELinBLUE/Paw-FakerDynamicValue 28 | -------------------------------------------------------------------------------- /test/FakerGenerator.spec.js: -------------------------------------------------------------------------------- 1 | import { use, expect } from 'chai'; 2 | import dirtyChai from 'dirty-chai'; 3 | 4 | import FakerGenerator from '../src/FakerGenerator'; 5 | 6 | use(dirtyChai); 7 | 8 | describe('FakerGenerator', () => { 9 | it('Returns an empty string if the category is invalid', () => { 10 | const generator = new FakerGenerator('en', 'invalid'); 11 | 12 | const result = generator.generate(); 13 | 14 | expect(result).to.be.empty(); 15 | }); 16 | 17 | it('Returns an empty string if the category is valid but the method is invalid', () => { 18 | const generator = new FakerGenerator('en', 'internet', 'invalid'); 19 | 20 | const result = generator.generate(); 21 | 22 | expect(result).to.be.empty(); 23 | }); 24 | 25 | // FIXME: This should use a spy rather than use the real class 26 | it('Calls faker', () => { 27 | const generator = new FakerGenerator('en', 'random', 'boolean'); 28 | 29 | const result = generator.generate(); 30 | 31 | expect(result).to.be.a('boolean'); 32 | }); 33 | 34 | // FIXME: This should use a spy rather than use the real class 35 | it('Passes the arguments to faker', () => { 36 | const generator = new FakerGenerator('en', 'random', 'number', '{ min: 10, max: 10 }'); 37 | 38 | const result = generator.generate(); 39 | 40 | expect(result).to.be.equal(10); 41 | }); 42 | }); 43 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .DEFAULT_GOAL := help 2 | .PHONY: build test 3 | .SILENT: 4 | 5 | YELLOW := $(shell tput -Txterm setaf 3) 6 | RESET := $(shell tput -Txterm sgr0) 7 | 8 | identifier = com.rebelinblue.PawExtensions.FakerDynamicValue 9 | extensions_dir = $(HOME)/Library/Containers/com.luckymarmot.Paw/Data/Library/Application Support/com.luckymarmot.Paw/Extensions/ 10 | 11 | ## Build the extension 12 | build: 13 | npm install 14 | npm run build 15 | cp README.md LICENSE.md ./build/$(identifier)/ 16 | 17 | ## Clean up the build directory 18 | clean: 19 | rm -Rf ./build/ 20 | 21 | ## Install the extension 22 | install: clean build 23 | mkdir -p "$(extensions_dir)$(identifier)/" 24 | cp -r ./build/$(identifier)/* "$(extensions_dir)$(identifier)/" 25 | 26 | ## Run tests 27 | test: 28 | npm run test 29 | 30 | ## Run eslint 31 | lint: 32 | npm run lint 33 | 34 | ## Generate code coverage 35 | coverage: 36 | npm run test:coverage 37 | 38 | ## Create an archive for the extension 39 | archive: 40 | ifndef TRAVIS_TAG 41 | cd ./build/; zip -r FakerDynamicValue.zip "$(identifier)/" 42 | else 43 | cd ./build/; zip -r FakerDynamicValue-$(TRAVIS_TAG).zip "$(identifier)/" 44 | endif 45 | 46 | ## Prints this help 47 | help: 48 | @echo "\nUsage: make ${YELLOW}${RESET}\n\nThe following targets are available:\n"; 49 | @awk -v skip=1 \ 50 | '/^##/ { sub(/^[#[:blank:]]*/, "", $$0); doc_h=$$0; doc=""; skip=0; next } \ 51 | skip { next } \ 52 | /^#/ { doc=doc "\n" substr($$0, 2); next } \ 53 | /:/ { sub(/:.*/, "", $$0); printf "\033[34m%-30s\033[0m\033[1m%s\033[0m %s\n", $$0, doc_h, doc; skip=1 }' \ 54 | $(MAKEFILE_LIST) 55 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Paw-FakerDynamicValue", 3 | "version": "1.1.0", 4 | "description": "A dynamic value extension for Paw using Faker to generate data", 5 | "main": "src/FakerDynamicValue.js", 6 | "author": "Stephen Ball", 7 | "license": "MIT", 8 | "homepage": "https://github.com/REBELinBLUE/paw-faker", 9 | "dependencies": { 10 | "faker": "^5.4.0", 11 | "istanbul": "^0.4.5" 12 | }, 13 | "devDependencies": { 14 | "@babel/cli": "^7.8.4", 15 | "@babel/core": "^7.9.6", 16 | "@babel/plugin-proposal-class-properties": "^7.8.3", 17 | "@babel/preset-env": "^7.9.6", 18 | "@babel/register": "^7.9.0", 19 | "babel-eslint": "^10.1.0", 20 | "babel-loader": "^8.1.0", 21 | "chai": "^4.2.0", 22 | "dirty-chai": "^2.0.1", 23 | "eslint": "^6.8.0", 24 | "eslint-config-airbnb-base": "^14.1.0", 25 | "eslint-plugin-import": "^2.20.2", 26 | "mocha": "^7.1.2", 27 | "nyc": "^15.0.1", 28 | "path": "^0.12.7", 29 | "rimraf": "^3.0.2", 30 | "uglifyjs-webpack-plugin": "^2.2.0", 31 | "webpack": "^4.43.0", 32 | "webpack-cli": "^3.3.11" 33 | }, 34 | "scripts": { 35 | "build": "rimraf build/ && webpack --bail --display-error-details", 36 | "build:prod": "NODE_ENV=production rimraf build/ && webpack --bail --display-error-details", 37 | "test": "NODE_ENV=test mocha", 38 | "test:coverage": "NODE_ENV=test nyc -x src/__mocks__/shims.js --reporter=lcovonly ./node_modules/mocha/bin/_mocha", 39 | "lint": "eslint src/ test/" 40 | }, 41 | "repository": { 42 | "type": "git", 43 | "url": "git+https://github.com/REBELinBLUE/paw-faker.git" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /.github/settings.yml: -------------------------------------------------------------------------------- 1 | # These settings are synced to GitHub by https://probot.github.io/apps/settings/ 2 | 3 | repository: 4 | name: Paw-FakerDynamicValue 5 | description: A dynamic value extension for Paw using Faker to generate data 6 | topics: paw, http, faker, mock 7 | 8 | private: false 9 | archived: false 10 | 11 | has_issues: true 12 | has_projects: false 13 | has_wiki: false 14 | has_downloads: true 15 | 16 | default_branch: master 17 | delete_branch_on_merge: true 18 | 19 | allow_squash_merge: true 20 | allow_merge_commit: true 21 | allow_rebase_merge: true 22 | 23 | labels: 24 | - name: bug 25 | color: '#CC0000' 26 | description: An issue with the code 27 | 28 | - name: feature 29 | color: '#336699' 30 | description: New functionality 31 | 32 | - name: chore 33 | color: '#f2df8c' 34 | description: Repository or code maintenance 35 | 36 | - name: documentation 37 | color: '#6cb524' 38 | description: Change in the documentation 39 | 40 | - name: dependencies 41 | color: '#70f9e0' 42 | description: Update dependencies 43 | 44 | branches: 45 | - name: master 46 | protection: 47 | required_linear_history: true 48 | required_signatures: false 49 | allow_force_pushes: false 50 | allow_deletions: false 51 | 52 | required_pull_request_reviews: 53 | required_approving_review_count: 1 54 | dismiss_stale_reviews: true 55 | require_code_owner_reviews: true 56 | 57 | required_status_checks: 58 | strict: true 59 | contexts: 60 | - codecov/patch 61 | - codecov/project 62 | - "Travis CI - Branch" 63 | 64 | enforce_admins: true 65 | 66 | restrictions: ~ 67 | -------------------------------------------------------------------------------- /test/FakerDynamicValue.spec.js: -------------------------------------------------------------------------------- 1 | import { use, expect } from 'chai'; 2 | import dirtyChai from 'dirty-chai'; 3 | 4 | import FakerDynamicValue from '../src/FakerDynamicValue'; 5 | 6 | use(dirtyChai); 7 | 8 | describe('FakerDynamicValue', () => { 9 | let dynamicValues; 10 | 11 | beforeEach(() => { 12 | dynamicValues = new FakerDynamicValue(); 13 | }); 14 | 15 | it('Should return the title', () => { 16 | expect(dynamicValues.title()).to.be.equal(FakerDynamicValue.title); 17 | }); 18 | 19 | it('Should return empty text when no method or category are set', () => { 20 | expect(dynamicValues.text()).to.be.empty(); 21 | }); 22 | 23 | it('Should return empty text when no method is set', () => { 24 | dynamicValues.category = 'internet'; 25 | 26 | expect(dynamicValues.text()).to.be.empty(); 27 | }); 28 | 29 | it('Should return empty text when no category is set', () => { 30 | dynamicValues.method = 'password'; 31 | 32 | expect(dynamicValues.text()).to.be.empty(); 33 | }); 34 | 35 | it('Should return return the category and method when both are set', () => { 36 | dynamicValues.category = 'internet'; 37 | dynamicValues.method = 'password'; 38 | 39 | expect(dynamicValues.text()).to.be.equal('internet.password()'); 40 | }); 41 | 42 | it('Should return return the category and method with options when all are set', () => { 43 | dynamicValues.category = 'internet'; 44 | dynamicValues.method = 'password'; 45 | dynamicValues.options = '15, true'; 46 | 47 | expect(dynamicValues.text()).to.be.equal('internet.password(15, true)'); 48 | }); 49 | 50 | // FIXME: This should use a spy rather than use the real class as now we are 51 | // testing something outside the scope of this test 52 | it('Should call the FakerGenerator', () => { 53 | dynamicValues.locale = 'en'; 54 | dynamicValues.category = 'random'; 55 | dynamicValues.method = 'number'; 56 | dynamicValues.options = '{ min: 10, max: 10 }'; 57 | 58 | const result = dynamicValues.evaluate(); 59 | 60 | expect(result).to.be.equal(10); 61 | }); 62 | }); 63 | -------------------------------------------------------------------------------- /src/FakerDynamicValue.js: -------------------------------------------------------------------------------- 1 | import faker from 'faker'; 2 | import FakerGenerator from './FakerGenerator'; 3 | import { registerDynamicValueClass, InputField } from './__mocks__/shims'; 4 | 5 | function getLocaleList() { 6 | const locales = {}; 7 | 8 | Object.keys(faker.locales).forEach((key) => { 9 | locales[key] = faker.locales[key].title; 10 | }); 11 | 12 | return locales; 13 | } 14 | 15 | export default class FakerDynamicValue { 16 | static title = 'Faker'; 17 | 18 | static identifier = 'com.rebelinblue.PawExtensions.FakerDynamicValue'; 19 | 20 | static help = 'https://github.com/REBELinBLUE/Paw-FakerDynamicValue#readme'; 21 | 22 | static inputs = [ 23 | new InputField('locale', 'Language', 'Select', { 24 | choices: getLocaleList(), 25 | persisted: true, 26 | }), 27 | 28 | new InputField('category', 'Category', 'Select', { 29 | choices: { 30 | address: 'Address', 31 | random: 'Basic Random Data', 32 | commerce: 'Commerce', 33 | company: 'Company', 34 | database: 'Database', 35 | date: 'Dates', 36 | finance: 'Finance', 37 | git: 'Git', 38 | hacker: 'Hacker', 39 | helpers: 'Helpers', 40 | image: 'Images', 41 | internet: 'Internet', 42 | name: 'Names', 43 | phone: 'Phone', 44 | lorem: 'Text', 45 | system: 'System', 46 | time: 'Time', 47 | music: 'Music', 48 | vehicle: 'Vehicle', 49 | }, 50 | }), 51 | 52 | new InputField('method', 'Method', 'String'), 53 | 54 | new InputField('options', 'Arguments', 'String'), 55 | ]; 56 | 57 | constructor() { 58 | this.context = null; 59 | this.locale = null; 60 | this.category = null; 61 | this.method = null; 62 | this.options = null; 63 | } 64 | 65 | title(context) { 66 | this.context = context; 67 | 68 | return FakerDynamicValue.title; 69 | } 70 | 71 | text(context) { 72 | this.context = context; 73 | 74 | if (this.category && this.method) { 75 | return `${this.category}.${this.method}(${this.options ? this.options : ''})`; 76 | } 77 | 78 | return ''; 79 | } 80 | 81 | evaluate(context) { 82 | this.context = context; 83 | 84 | const generator = new FakerGenerator( 85 | this.locale, 86 | this.category, 87 | this.method, 88 | this.options, 89 | ); 90 | 91 | return generator.generate(); 92 | } 93 | } 94 | 95 | registerDynamicValueClass(FakerDynamicValue); 96 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Paw-FakerDynamicValue 2 | 3 | [![Build Status](https://img.shields.io/travis/com/REBELinBLUE/Paw-FakerDynamicValue/master.svg?style=flat-square&label=Travis+CI)](https://travis-ci.com/REBELinBLUE/Paw-FakerDynamicValue) 4 | [![Code Coverage](https://img.shields.io/codecov/c/github/REBELinBLUE/Paw-FakerDynamicValue/master.svg?style=flat-square&label=Coverage)](https://codecov.io/gh/REBELinBLUE/Paw-FakerDynamicValue) 5 | [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square&label=License)](/LICENSE.md) 6 | 7 | A dynamic value extension for [Paw](http://paw.cloud) using [Faker](https://github.com/faker-js/faker) to generate data. 8 | 9 | ## Usage 10 | 11 | To use the extension simply insert the dynamic value from the right click menu > Add Dynamic Value.. > Extension > Faker. 12 | 13 | Select the `language` for the data and the `category` of the data you wish to generate. Then enter the name of the `method` to call. Finally enter the `arguments`, these should be in exactly the same format as if you were writing the javascript directly (i.e. strings quoted and each argument separated by a comma). 14 | 15 | ### Examples 16 | 17 | **Method with no arguments** 18 | 19 | * *Category*: `Basic Random Data` 20 | * *Method*: `uuid` 21 | 22 | *Equivalent to*: `faker.random.uuid();` 23 | 24 | **Method with single argument** 25 | 26 | * *Category*: `Internet` 27 | * *Method*: `password` 28 | * *Arguments*: `8` 29 | 30 | *Equivalent to*: `faker.internet.password(8);` 31 | 32 | **Method with multiple arguments** 33 | 34 | * *Category*: `Commerce` 35 | * *Method*: `price` 36 | * *Arguments*: `1.10, 5.00, 2, '£'` 37 | 38 | *Equivalent to*: `faker.commerce.price(1.10, 5.00, 2, '£');` 39 | 40 | **Method with an array argument** 41 | 42 | * *Category*: `Basic Random Data` 43 | * *Method*: `arrayElement` 44 | * *Arguments*: `['one', 'two', 'three', 'four']` 45 | 46 | *Equivalent to*: `faker.random.arrayElement(['one', 'two', 'three', 'four']);` 47 | 48 | **Method with an object argument** 49 | 50 | * *Category*: `Basic Random Data` 51 | * *Method*: `number` 52 | * *Arguments*: `{ min: 10, max: 100 }` 53 | 54 | *Equivalent to*: `faker.random.number({ min: 10, max: 100 });` 55 | 56 | See the [Faker wiki](https://github.com/Marak/faker.js/wiki) for the list of available categories, methods and the arguments. 57 | 58 | ## Installing 59 | 60 | To install directly from source you will need to clone the repository and the build the code using the following commands 61 | 62 | ```bash 63 | $ git clone https://github.com/REBELinBLUE/Paw-FakerDynamicValue.git 64 | $ cd Paw-FakerDynamicValue 65 | $ npm install 66 | $ NODE_ENV=production make install 67 | ``` 68 | 69 | You can also download the latest build from the [releases](https://github.com/REBELinBLUE/Paw-FakerDynamicValue/releases) tab, then simply extract to the extensions directory. (See Paw > Extensions > Open Extensions Directory). 70 | 71 | ## License 72 | 73 | Paw-FakerDynamicValue is licensed under [The MIT License (MIT)](/LICENSE.md). 74 | --------------------------------------------------------------------------------