Node.js:faker生成虚拟测试数据
文档:https://www.npmjs.com/package/faker安装
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);
/*
贾文
冯京市
*/
文档来源:51CTO技术博客https://blog.51cto.com/u_13567403/3039800
页:
[1]