Faker.js虚假数据生成
Faker.js 可以在浏览器和 node.js 中生成大量的虚假数据。
用法:
浏览器
<script src = "faker.js" type = "text/javascript"></script> <script> var randomName = faker.Name.findName(); // Caitlyn Kerluke var randomEmail = faker.Internet.email(); // Rusty@arne.info var randomCard = faker.Helpers.createCard(); // random contact card containing many properties </script>
node.js
var faker = require('./faker'); var randomName = faker.Name.findName(); // Rowan Nikolaus var randomEmail = faker.Internet.email(); // Kassandra.Haley@erich.biz var randomCard = faker.Helpers.createCard(); // random contact card containing many properties
评论