Skip to content

deployable/node-deployable-mixin-class_uid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Class UUID Mixin

Attach a UUID to a class as class_uid and add generateUuid() helper functions

Install

npm install deployable-mixin-class_uid --save

yarn add deployable-mixin-class_uid

Usage

const mix = require('mixwith').mix
const MixinClassUid = require('deployable-mixin-class_uid')
class SomeMix = {}
class Some extends mix(SomeMix).with(MixinClassUid) {}

let obj = new Some()
console.log(obj.class_uid)
console.log(obj.generateUuid())

API

Class.generateUuid(version)

Static method to generate a uuid. Pass a version v1 or v4

.class_uid

Get or set the uid on the class via a property

.generateUuid(version)

Instance method to generate a uuid. Pass a version v1 or v4

License

deployable-mixin-class_uid is released under the MIT license. Copyright 2016 Matt Hoyle

https://github.com/deployable/deployable-mixin-class_uid