安装
npm i faker
示例
var faker = require("faker"); faker.locale = "zh_CN"; // 设置为中文 var name = faker.name.lastName() + faker.name.firstName(); var city = faker.address.city(); console.log(name); console.log(city); /* 贾文 冯京市 */
安装
npm i faker
示例
var faker = require("faker"); faker.locale = "zh_CN"; // 设置为中文 var name = faker.name.lastName() + faker.name.firstName(); var city = faker.address.city(); console.log(name); console.log(city); /* 贾文 冯京市 */