Skip to content
Browse files

Initial commit

  • Loading branch information...
0 parents commit a972fe7e5335ee1a8222cb7ebd8c7851f90ea0f6 Elias Klughammer committed Jan 21, 2012
Showing with 86 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +1 −0 .npmignore
  3. +3 −0 .tm_properties
  4. +4 −0 CHANGELOG.md
  5. +20 −0 LICENSE
  6. +24 −0 README.md
  7. 0 examples/.empty
  8. +1 −0 index.js
  9. +14 −0 lib/randomstring.js
  10. +15 −0 package.json
4 .gitignore
@@ -0,0 +1,4 @@
+.DS_Store
+*.log
+node_modules
+.tm_properies
1 .npmignore
@@ -0,0 +1 @@
+*.log
3 .tm_properties
@@ -0,0 +1,3 @@
+include = "{.tm_properties,.gitignore,.gitmodules}"
+tabSize = 4
+softTabs = true
4 CHANGELOG.md
@@ -0,0 +1,4 @@
+1.0.0 / Jan 21, 2012
+==================
+ * Start of the project
+
20 LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2012 Elias Klughammer
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 README.md
@@ -0,0 +1,24 @@
+# node-randomstring
+
+## Installation
+
+To install randomstring, use [npm](http://github.com/isaacs/npm):
+
+ $ npm install randomstring
+
+## Usage
+
+```
+var randomstring = require("randomstring");
+
+randomstring.generate();
+// >> "XwPp9xazJ0ku5CZnlmgAx2Dld8SHkAeT"
+
+randomstring.generate(7);
+// >> "xqm5wXX"
+
+```
+
+## LICENSE
+
+node-randomstring is licensed under the MIT license.
0 examples/.empty
No changes.
1 index.js
@@ -0,0 +1 @@
+module.exports = require("./lib/randomstring");
14 lib/randomstring.js
@@ -0,0 +1,14 @@
+var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
+
+exports.generate = function(length) {
+ length = length ? length : 32;
+
+ var string = "";
+
+ for (var i=0; i<length; i++) {
+ var randomNumber = Math.floor(Math.random() * chars.length);
+ string += chars.substring(randomNumber, randomNumber + 1);
+ }
+
+ return string;
+}
15 package.json
@@ -0,0 +1,15 @@
+{
+ "name": "randomstring",
+ "version": "1.0.0",
+ "author": "Elias Klughammer <elias.klughammer@me.com> (http://www.elias.kg)",
+ "description": "A module for generating random strings",
+ "homepage": "https://github.com/eliaskg/node-randomstring",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/felixge/node-mysql.git"
+ },
+ "main": "./index",
+ "engines": {
+ "node": "*"
+ }
+}

0 comments on commit a972fe7

Please sign in to comment.
Something went wrong with that request. Please try again.