Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

short-uuid

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

short-uuid - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

.codeclimate.yml

16

CHANGELOG.md

@@ -5,2 +5,18 @@ # Change Log

## [2.1.0] - 2016-11-06
### Added
- Add browser support with Browserify as proposed by [voronianski](https://github.com/voronianski)
- Include `grunt-mkdir` to support build process
- Include `grunt-browserify` to support build process
- Include `grunt-contrib-uglify` to support build process
- Add example/index.html for Browserify demo
- Add various dotfiles for CodeClimate configs
### Changed
- Add to [gruntfile.js] for new modules
- Add to [package.json] for build command
- Add dist folder to [.gitignore]
- Update [revisions.md]
- Update [README.md] with Browserify details
## [2.0.0] - 2016-06-19

@@ -7,0 +23,0 @@ ### Added

@@ -11,2 +11,21 @@ /**

pkg: grunt.file.readJSON('package.json'),
browserify: {
"dist/short-uuid.js": ["index.js"],
options: {
browserifyOptions: {
builtins: false,
commondir: false,
detectGlobals: false,
insertGlobalVars: ['__filename', '__dirname'],
'standalone' : 'ShortUUID'
}
}
},
mkdir: {
all: {
options: {
create: ['dist']
}
}
},
mocha_istanbul: {

@@ -29,2 +48,12 @@ coverage: {

all: { src: ['test/*.js'] }
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
my_target: {
files: {
'dist/short-uuid.min.js': ['dist/short-uuid.js']
}
}
}

@@ -37,2 +66,8 @@ });

grunt.loadNpmTasks('grunt-mkdir');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default',

@@ -46,2 +81,5 @@ ['mocha_istanbul']);

['mocha_istanbul']);
grunt.registerTask('build',
['mkdir','browserify','uglify']);
};

1

index.js

@@ -85,2 +85,1 @@ /**

}());
{
"name": "short-uuid",
"version": "2.0.0",
"version": "2.1.0",
"description": "Create and translate standard UUIDs with shorter formats.",

@@ -8,3 +8,4 @@ "main": "index.js",

"test": "grunt test",
"cover": "grunt cover"
"cover": "grunt cover",
"build": "grunt build"
},

@@ -17,2 +18,4 @@ "repository": {

"uuid",
"guid",
"uid",
"node"

@@ -33,8 +36,10 @@ ],

"grunt": "^1.0.1",
"grunt-browserify": "^5.0.0",
"grunt-contrib-uglify": "^2.0.0",
"grunt-mkdir": "^1.0.0",
"grunt-mocha-istanbul": "^5.0.1",
"grunt-simple-mocha": "^0.4.1",
"istanbul": "^0.4.3",
"mocha": "^2.5.3",
"node-uuid": "^1.4.7"
"mocha": "^2.5.3"
}
}

@@ -9,5 +9,7 @@ # short-uuid

## v2.0.0
## v2.1.0
2.0 is a major rework to make the library more capable and useful. It now provides RFC4122 v4-compliant UUIDs,
2.1 adds Browserify config to support client-side use. The library is exposed as `ShortUUID`.
short-uuid provides RFC4122 v4-compliant UUIDs,
thanks to [`node-uuid`](https://github.com/broofa/node-uuid).

@@ -30,3 +32,3 @@

translator.toUUID(shortId);
translator.from UUID(regularUUID);
translator.fromUUID(regularUUID);

@@ -42,4 +44,4 @@ // See the alphabet used by a translator

v2.0.0 is around 700 bytes when compressed with UglifyJS2 (702) or Closure Compiler (714 on Simple, 642 on Advanced).
v2.1.0 is under 1K when compressed. Using Browserify, the library and dependencies are less than 5K.
Please see [Revisions](revisions.md) for information on previous versions.
# Revisions
# v2.0.0
2.0 is a major rework to make the library more capable and useful. It now provides RFC4122 v4-compliant UUIDs,
thanks to [`node-uuid`](https://github.com/broofa/node-uuid).
```javascript
var short = require('short-uuid');
var translator = short(); // Defaults to flickrBase58
var decimalTranslator = short("0123456789"); // Provide a specific alphabet for translation
var cookieTranslator = short(short.constants.cookieBase90); // Use a constant for translation
// Generate a shortened v4 UUID
translator.new();
// Generate plain UUIDs
short.uuid(); // From the constructor without creating a translator
translator.uuid(); // Each translator provides the uuid.v4() function
// Translate UUIDs
translator.toUUID(shortId);
translator.fromUUID(regularUUID);
// See the alphabet used by a translator
translator.alphabet
// View the constants
short.constants.flickrBase58;
short.constants.cookieBase90;
```
# v1.0.0

@@ -4,0 +35,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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