Skip to content

Instantly share code, notes, and snippets.

@EddyVerbruggen
Last active March 1, 2017 09:09
Show Gist options
  • Save EddyVerbruggen/28ae0759a806318af25e586255f3c6af to your computer and use it in GitHub Desktop.
Save EddyVerbruggen/28ae0759a806318af25e586255f3c6af to your computer and use it in GitHub Desktop.
Require node-uuid with nativescript-nodeify
// adding this line to your app...
var uuid = require('node-uuid');
console.log("uuid.v1: " + uuid.v1());
// ... no longer leads to a crash but this output instead:
// uuid.v1: f7c65940-fe57-11e6-a543-e5004118dcb5
// ... which is because the plugin changed this line in uuid.js:
var _rb = require('crypto').randomBytes;
// ... to this:
var _rb = require('nativescript-nodeify/node_modules/crypto-browserify').randomBytes;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment