Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5187103
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# gen-uuid | ||
|
||
Generate RFC4122 version 1 or version 4 UUIDs using [node-uuid](https://github.com/shtylman/node-uuid) | ||
|
||
## Installation | ||
|
||
``` | ||
[sudo] npm install gen-uuid -g | ||
``` | ||
|
||
## Usage | ||
|
||
``` | ||
Usage: gen-uuid [options] | ||
Options: | ||
-h, --help output usage information | ||
-V, --version output the version number | ||
-1, --v1 use v1 (timestamp-based), default is v4 (random) | ||
-n, --number [n] output n number of UUIDs, min 1, max 100, default 1 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env node | ||
|
||
var program = require('commander'); | ||
var uuid = require('uuid'); | ||
|
||
program | ||
.version('0.0.1') | ||
.option('-1, --v1', 'use v1 (timestamp-based), default is v4 (random)') | ||
.option('-n, --number [n]', 'output n number of UUIDs, min 1, max 100, default 1', '1') | ||
.parse(process.argv); | ||
|
||
var method = program.v1 ? 'v1' : 'v4'; | ||
var count = Math.min(100, Math.max(1, program.number | 0)); | ||
|
||
while (count-- > 0) | ||
console.log(uuid[method]()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "gen-uuid", | ||
"version": "0.0.1", | ||
"author": "David Brockman Smoliansky", | ||
"description": "CLI to generate v1 and v4 UUIDs", | ||
"preferGlobal": true, | ||
"bin": { | ||
"gen-uuid": "./bin/gen-uuid" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "http://github.com/dbrockman/gen-uuid.git" | ||
}, | ||
"keywords": [ | ||
"cli", | ||
"uuid" | ||
], | ||
"dependencies": { | ||
"commander": "~1.1.1", | ||
"uuid": "~1.4.1" | ||
}, | ||
"engines": { | ||
"node": ">= 0.6.x" | ||
} | ||
} |