{"action":"created","issue":{"url":"https://api.github.com/repos/Marak/faker.js/issues/316","repository_url":"https://api.github.com/repos/Marak/faker.js","labels_url":"https://api.github.com/repos/Marak/faker.js/issues/316/labels{/name}","comments_url":"https://api.github.com/repos/Marak/faker.js/issues/316/comments","events_url":"https://api.github.com/repos/Marak/faker.js/issues/316/events","html_url":"https://github.com/Marak/faker.js/issues/316","id":121892180,"number":316,"title":"[Feature request] Method for generate any fake data randomly and be posible exclude any type","user":{"login":"xergioalex","id":2729395,"avatar_url":"https://avatars.githubusercontent.com/u/2729395?v=3","gravatar_id":"","url":"https://api.github.com/users/xergioalex","html_url":"https://github.com/xergioalex","followers_url":"https://api.github.com/users/xergioalex/followers","following_url":"https://api.github.com/users/xergioalex/following{/other_user}","gists_url":"https://api.github.com/users/xergioalex/gists{/gist_id}","starred_url":"https://api.github.com/users/xergioalex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xergioalex/subscriptions","organizations_url":"https://api.github.com/users/xergioalex/orgs","repos_url":"https://api.github.com/users/xergioalex/repos","events_url":"https://api.github.com/users/xergioalex/events{/privacy}","received_events_url":"https://api.github.com/users/xergioalex/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-13T01:54:16Z","updated_at":"2016-03-19T08:18:27Z","closed_at":null,"body":"Hello, i think is really helpful if you can generate any data randomly for testing, and have the posibility of exclude any type.\r\n\r\n* For example i want generate fake data that aren't an email.\r\n\r\n**This is my code for that, but if this can include it in API gonna be awesome.**\r\n\r\n```javascript\r\n// Set random faker methods\r\nFakerCategories = ['address', 'commerce', 'company', 'date', 'finance', 'hacker', 'image', 'internet', 'lorem', 'name', 'phone', 'random'];\r\nFakerMethods = {\r\n\taddress: ['address', 'zipCode', 'city', 'cityPrefix', 'citySuffix', 'streetName', 'streetAddress', 'streetSuffix', 'streetPrefix', 'secondaryAddress', 'county', 'country', 'countryCode', 'state', 'stateAbbr', 'latitude', 'longitude'],\r\n\tcommerce: ['color', 'department', 'productName', 'price', 'productAdjective', 'productMaterial', 'product'],\r\n\tcompany: ['suffixes', 'companyName', 'companySuffix', 'catchPhrase', 'bs', 'catchPhraseAdjective', 'catchPhraseDescriptor', 'catchPhraseNoun', 'bsAdjective', 'bsBuzz', 'bsNoun'],\r\n\tdate: ['past', 'future', 'between', 'recent', 'month', 'weekday'],\r\n\tfinance: ['account', 'accountName', 'mask', 'amount', 'transactionType', 'currencyCode', 'currencyName', 'currencySymbol'],\r\n\thacker: ['abbreviation', 'adjective', 'noun', 'verb', 'ingverb', 'phrase'],\r\n\timage: ['image', 'avatar', 'imageUrl', 'abstract', 'animals', 'business', 'cats', 'city', 'food', 'nightlife', 'fashion', 'people', 'nature', 'sports', 'technics', 'transport'],\r\n\tinternet: ['avatar', 'email', 'userName', 'protocol', 'url', 'domainName', 'domainSuffix', 'domainWord', 'ip', 'userAgent', 'color', 'mac', 'password'],\r\n\tlorem: ['words', 'sentence', 'sentences', 'paragraph', 'paragraphs'],\r\n\tname: ['firstName', 'lastName', 'findName', 'jobTitle', 'prefix', 'suffix', 'title', 'jobDescriptor', 'jobArea', 'jobType'],\r\n\tphone: ['phoneNumber', 'phoneNumberFormat', 'phoneFormats'],\r\n\trandom: ['number', 'uuid']\r\n};\r\n\r\n// Get fake data from any method in faker API\r\nfaker.fakeData = function (excludeElement) {\r\n\tvar randomCategory = faker.random.arrayElement(FakerCategories);\r\n\tdo {\r\n\t\trandomMethod = faker.random.arrayElement(FakerMethods[randomCategory]);\r\n\t} while (excludeElement && excludeElement === randomMethod);\r\n\treturn faker[randomCategory][randomMethod]();\r\n};\r\n```"},"comment":{"url":"https://api.github.com/repos/Marak/faker.js/issues/comments/198667260","html_url":"https://github.com/Marak/faker.js/issues/316#issuecomment-198667260","issue_url":"https://api.github.com/repos/Marak/faker.js/issues/316","id":198667260,"user":{"login":"greyhwndz","id":13173749,"avatar_url":"https://avatars.githubusercontent.com/u/13173749?v=3","gravatar_id":"","url":"https://api.github.com/users/greyhwndz","html_url":"https://github.com/greyhwndz","followers_url":"https://api.github.com/users/greyhwndz/followers","following_url":"https://api.github.com/users/greyhwndz/following{/other_user}","gists_url":"https://api.github.com/users/greyhwndz/gists{/gist_id}","starred_url":"https://api.github.com/users/greyhwndz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greyhwndz/subscriptions","organizations_url":"https://api.github.com/users/greyhwndz/orgs","repos_url":"https://api.github.com/users/greyhwndz/repos","events_url":"https://api.github.com/users/greyhwndz/events{/privacy}","received_events_url":"https://api.github.com/users/greyhwndz/received_events","type":"User","site_admin":false},"created_at":"2016-03-19T08:18:27Z","updated_at":"2016-03-19T08:18:27Z","body":"The exclusion feature would really be great! :+1: "}}