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

worksmith_etcd

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

worksmith_etcd - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

3

package.json
{
"name": "worksmith_etcd",
"version": "0.0.1",
"version": "0.1.0",
"description": "Etcd activites for worksmith",

@@ -26,2 +26,3 @@ "main": "index.js",

"node-etcd": "^4.0.2",
"node-uuid": "^1.4.3",
"worksmith": "0.0.22"

@@ -28,0 +29,0 @@ },

@@ -39,3 +39,3 @@ # worksmith_etcd

key | string | The etcd key to be used in the lock
value | string | Optional value for the lock, defaults to ```new Date().getTime()```
value | string | Optional value for the lock, defaults to a uuid
ttl | integer | Optional time in secords before the lock automatically expires

@@ -42,0 +42,0 @@

var debug = require('debug')('worksmith:tasks:etcd:lock')
var uuid = require('node-uuid').v4

@@ -9,3 +10,3 @@ module.exports = function(definition) {

var key = context.get(definition.key)
var value = context.get(definition.value) || new Date().getTime()
var value = context.get(definition.value) || uuid()
var ttl = context.get(definition.ttl)

@@ -12,0 +13,0 @@

var worksmith = require('worksmith')
var lock = require('../')('lock')
var Etcd = require('node-etcd')
var format = require('util').format

@@ -65,3 +66,3 @@ describe('lock', function() {

it('should default the lock value to the current time in millis', function(done) {
it('should default the lock value to a uuid', function(done) {

@@ -74,4 +75,2 @@ var workflow = worksmith({

var before = new Date().getTime()
workflow({}, function(err) {

@@ -82,4 +81,3 @@ assert.ifError(err)

assert.ok(result.node.value)
assert.ok(result.node.value >= before)
assert.ok(result.node.value <= before + 1000)
assert.ok(/\w+-\w+-\w+-\w+-\w+/.test(result.node.value), format('%s failed to match expected pattern', result.node.value))
done()

@@ -86,0 +84,0 @@ })

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