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

Text generator. Small tool for generating funny sentences in English

  • 0.0.42
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.2K
decreased by-22.64%
Maintainers
1
Weekly downloads
 
Created
Source

txtgen

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

Just available on Node.js v6.0.0 or newer and the browsers with ES6 support.

View DEMO.

NPM Travis Coverage Status devDependency Status

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 phrase = txtgen.phrase();
  console.log(phrase);

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

APIs

  • .sentence()
  • .phrase([Number totalSentences])
  • .article([Number totalPhrases])

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 27 May 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