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

node-red-contrib-dayjs

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

node-red-contrib-dayjs - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

test/day_spec.js

21

day.js

@@ -12,2 +12,3 @@ module.exports = function(RED) {

var toObject = require('dayjs/plugin/toObject')
var relativeTime = require('dayjs/plugin/relativeTime')
dayjs.extend(utc)

@@ -18,2 +19,3 @@ dayjs.extend(timezone)

dayjs.extend(toObject)
dayjs.extend(relativeTime)

@@ -59,2 +61,17 @@ this.outputFormat = config.outputFormat || 'ISOString';

case 'unix_millis':
return input.valueOf()
case 'unix':
return input.unix()
case 'fromNow':
return input.fromNow()
case 'toNow':
return input.toNow()
case 'daysInMonth':
return input.daysInMonth()
case 'Costum':

@@ -93,5 +110,5 @@ return input.format(costumFormatOutput)

let input = msg[msg_input_property]
let day = parsePayload(msg_input_property)
let day = parsePayload(input)
let day_tz = alterTimezone(day,node.outputTimezone,false)

@@ -98,0 +115,0 @@ let day_output = dayjs()

12

package.json
{
"name": "node-red-contrib-dayjs",
"version": "0.0.2",
"version": "0.1.0",
"description": "Wrapper of dayjs for Node-RED",
"main": "day.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "mocha \"test/**/*_spec.js\""
},

@@ -25,3 +25,3 @@ "repository": {

"node": ">=14"
},
},
"node-red": {

@@ -35,3 +35,9 @@ "version": ">=3.0.0",

"dayjs": "^1.11.10"
},
"devDependencies": {
"mocha": "^10.4.0",
"node-red": "^3.1.8",
"node-red-node-test-helper": "^0.3.3",
"should": "^13.2.3"
}
}

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