1.0.5 • Published 4 years ago

lorem-ipsum-tc v1.0.5

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

lorem-ipsum-tc

Creating Traditional Chinese lorem ipsum.

繁體中文測試文本生成工具

example

const loremIpsumTC = require('lorem-ipsum-tc')

let char = loremIpsumTC.createChar()
console.log(char)
// return a random character string.

let line = loremIpsumTC.createLine()
console.log(line)
// return a random line string.

let paragraph = loremIpsumTC.createParagraph()
console.log(paragraph)
// return a random paragraph string.

let article = loremIpsumTC.createArticle()
console.log(article)
// return a random article string.

Installation

npm i lorem-ipsum-tc

option

loremIpsumTC.createChar(charList)
loremIpsumTC.createLine(withLoren, numOfChar, charList)
loremIpsumTC.createParagraph(withLoren, numOfLine, charList)
loremIpsumTC.createArticle(
  withLoren,
  numOfParagraph,
  indent,
  skippingLine,
  charList
)
  • charList: string

    There is a default charList, however you can use your own charList by String. EX: loremIpsumTC.createChar("甲乙丙丁")

  • withLoren: boolean

    If withLoren is true, line or paragraph would start with "羅倫" which means lorem in Chinese. The default is true.

  • numOfChar: number

    The number of characters would be created.(ps. "羅倫" is NOT counted.) The default is random from 2 to 21.

  • numOfLine: number

    The number of lines would be created. The default is random from 3 to 7.

  • numOfParagraph: number

    The number of paragraphs would be created. The default is random from 3 to 7.

  • indent: string

    The indent of each paragraph. The default is 4 spaces.

  • skippingLine: string

    The skipping line between paragraphs. The default is '\n'.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT