Socket
Socket
Sign inDemoInstall

mice

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mice

fake data generator, 支持汉字


Version published
Maintainers
1
Install size
29.6 kB
Created

Readme

Source

mice 小白鼠

  • 简洁实用的测试数据生成接口

安装

npm install mice

使用

  
  var mice = require('mice')('cn'); // 目前只支持cn、en, 默认cn

  // 生成词语
  mice.word();  // 单个词语
  mice.words(10, '-'); // 10个词语, 并用分隔符‘-’连接


  // 句子
  mice.sentence(); // 单个句子
  mice.sentences(5, '<br>'); // 多个句子,并用分隔符‘<br>’连接
  mice.sentences(5, ['<p>', '</p>']); // 用首尾型tag连接

  // 段落
  mice.paragraph(); //当个段落
  mice.paragraphs(5, '<br>'); // 多个段落,分隔符使用同上


  // 英语接口与汉字一样。

inspiration

  • 汉字素材选用的是常用汉字,生僻字就不考虑了。
  • 英语素材选用借鉴了 https://github.com/boo1ean/casual

Keywords

FAQs

Last updated on 18 May 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc