文档:https://www.ctyun.cn/portal/link.html?target=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Ffaker
安装
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); /* 贾文 冯京市 */