lorem-ipsum
Advanced tools
Comparing version
@@ -11,2 +11,9 @@ #!/usr/bin/env node | ||
// Allow CLI user to run command with plain english. E.g. "lorem-ipsum 1 sentence" or "lorem-ipsum 3 words --copy" | ||
var nakedArguments = arguments._; | ||
if (nakedArguments.length >= 2) { | ||
arguments.count = nakedArguments[0]; // Clobber count. | ||
arguments.units = nakedArguments[1]; // Clobber units. | ||
} | ||
options.units = arguments.units || 'sentences'; | ||
@@ -26,2 +33,2 @@ options.count = arguments.count || 1; | ||
process.exit(); // Successful exit. | ||
} | ||
} |
@@ -10,6 +10,10 @@ var generator = function() { | ||
, format = options.format || 'plain' | ||
, words = require('./dictionary').words; | ||
, words = require('./dictionary').words | ||
, random = options.random || Math.random | ||
, inflection = require('inflection'); | ||
units = inflection.pluralize(units); | ||
var randomInteger = function(min, max) { | ||
return Math.floor(Math.random() * (max - min + 1) + min); | ||
return Math.floor(random() * (max - min + 1) + min); | ||
}; | ||
@@ -16,0 +20,0 @@ |
{ | ||
"name": "lorem-ipsum", | ||
"version": "0.1.0", | ||
"description": "Generates passages of lorem ipsum text suitable for use a placeholder in web pages, graphics, and more.", | ||
"version": "0.1.1", | ||
"description": "Generates passages of lorem ipsum text suitable for use as placeholder copy in web pages, graphics, and more.", | ||
"author": "Nickolas Kenyeres <nkenyeres@gmail.com> (http://knicklabs.github.com)", | ||
@@ -9,5 +9,8 @@ "license": "MIT/X11", | ||
"dependencies": { | ||
"optimist": "~0.3.5" | ||
"optimist": "~0.3.5", | ||
"inflection": "~1.2.6" | ||
}, | ||
"devDependencies": {}, | ||
"devDependencies": { | ||
"alea": "0.0.9" | ||
}, | ||
"optionalDependencies": {}, | ||
@@ -17,2 +20,5 @@ "bin": { | ||
}, | ||
"scripts": { | ||
"test": "nodeunit test" | ||
}, | ||
"repository": { | ||
@@ -19,0 +25,0 @@ "type": "git", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
11733
28.1%8
14.29%256
36.17%105
16.67%2
100%1
Infinity%+ Added
+ Added