Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrockman committed May 18, 2013
0 parents commit 5187103
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
node_modules
22 changes: 22 additions & 0 deletions README.md
@@ -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
```
16 changes: 16 additions & 0 deletions bin/gen-uuid
@@ -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]());
25 changes: 25 additions & 0 deletions package.json
@@ -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"
}
}

0 comments on commit 5187103

Please sign in to comment.