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

expire

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expire - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

.npmignore

28

lib/expire.js
var units = {
year: 31556926
, month: 2629743
year: 31536000
, month: 2592000
, week: 604800

@@ -58,2 +58,6 @@ , day: 86400

if (!str || typeof str !== 'string') {
return 0
}
var subs = str.split(/\sand\s/)

@@ -74,8 +78,4 @@

module.exports.units = units
module.exports.values = values
function setExpiration(res, time) {
module.exports.getSeconds = getSeconds
module.exports.setExpiration = function(res, time) {
var seconds = typeof time === 'number' ? time : getSeconds(time)

@@ -85,4 +85,14 @@ var date = new Date()

res['Expires'] = date.toUTCString()
res['Cache-Control'] = 'max-age='+seconds
res['expires'] = date.toUTCString()
res['cache-control'] = 'max-age='+seconds
return res
}
module.exports = {
units:units,
values:values,
getSeconds:getSeconds,
setExpiration:setExpiration
}
{
"name": "expire",
"version": "0.2.0",
"name": "expire",
"version": "0.3.0",
"description": "Convenient utility for client-side expiration",

@@ -8,4 +8,8 @@ "keywords": ["expiration", "expire"],

"author": "Weltschmerz <chlavois@gmail.com>",
"dependencies": {
"vows": "0.6.3"
},
"main": "lib/expire.js",
"scripts": { "test" : "node test/test.js" },
"engines": { "node": ">= 0.4.0" }
}

@@ -5,4 +5,6 @@ ## Expire

Expiration Date is a convenient little utility for abstracting some of the work you might do to afford robust cache strings.
`npm test expire`
Expire is a convenient little utility for abstracting some of the work you might do to afford robust cache strings.
```js

@@ -9,0 +11,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