
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
date.prototype.getyear
Advanced tools
An ES5 spec-compliant `Date.prototype.getYear` shim/polyfill/replacement that works as far down as ES3.
An ES spec-compliant Date.prototype.getYear shim/polyfill/replacement that works as far down as ES3.
This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec.
Because Date.prototype.getYear depends on a receiver (the “this” value), the main export takes the array to operate on as the first argument.
var getYear = require('date.prototype.getyear');
var assert = require('assert');
var d = new Date(Date.UTC(2000));
d.setHours(d.getHours() + (d.getTimezoneOffset() / 60)); // to account for the local TZ
assert.equal(getYear(d), 100);
var shim = require('date.prototype.getyear/shim');
var getPolyfill = require('date.prototype.getyear/polyfill');
var assert = require('assert');
/* when Date#getYear is not present */
delete Date.prototype.getYear;
var shimmed = shim();
assert.equal(shimmed, getPolyfill());
assert.equal(shimmed, Date.prototype.getYear);
assert.equal(new Date().getYear(), getYear(new Date()));
var shim = require('date.prototype.getyear/shim');
var assert = require('assert');
/* when Date#getYear is present */
var shimmed = shim();
assert.equal(shimmed, Date.prototype.getYear);
assert.equal(new Date().getYear(), getYear(new Date()));
Simply clone the repo, npm install, and run npm test
FAQs
An ES5 spec-compliant `Date.prototype.getYear` shim/polyfill/replacement that works as far down as ES3.
We found that date.prototype.getyear demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.