Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

txtgen

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

txtgen

Util for generating random sentences, paragraphs and articles in English

  • 0.1.10
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

txtgen

Util for generating random sentences, paragraphs and articles in English. Inspired by Sentencer and metaphorpsum.com.

This library is very lightweight to use at client side. Just about 160B gzip or 7KB minified!

NPM Travis Coverage Status devDependency Status Known Vulnerabilities

Demo

How does it work?.

Setup

Node.js
npm install txtgen --save
SystemJS
System.config({
  baseUrl: '/path/to/js/folder',
  map: {
    txtgen: 'txtgen.min'
  }
});

System.import('txtgen').then((txtgen) => {
  // use txtgen here
});
RequireJS
require.config({
  baseUrl: '/path/to/js/folder',
  paths: {
    txtgen: 'txtgen.min'
  }
});

requirejs('txtgen', (txtgen) => {
  // use txtgen here
});

CDN
<script type="text/javascript" src="https://cdn.rawgit.com/ndaidong/txtgen/master/dist/txtgen.min.js"></script>

Usage

  var txtgen = require('txtgen');

  let sentence = txtgen.sentence();
  console.log(sentence);

  let paragraph = txtgen.paragraph();
  console.log(paragraph);

  let article = txtgen.article();
  console.log(article);

APIs

  • .sentence()
  • .paragraph([Number totalSentences])
  • .article([Number totalParagraphs])

Test

git clone https://github.com/ndaidong/txtgen.git
cd txtgen
npm install
npm test

License

The MIT License (MIT)

Keywords

FAQs

Package last updated on 10 Jun 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc