is-before installation $ npm install is-before usage var isBefore = require('is-before') var now = new Date() var sometimeInThePast = new Date('1/1/1983') isBefore(sometimeInThePast, now) // true tests tk