
Security News
Cline CLI npm Package Compromised via Suspected Cache Poisoning Attack
A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.
browser-date-formatter
Advanced tools
Format dates real fancy-like in the browser. Good for search engines and humans.
Format dates real fancy-like in the browser. Good for search engines and humans.
This was originally implemented on the npmjs.com website, then proved useful enough to extract into a standalone module.
Weighs in at 4K, minified and gzipped.
npm install browser-date-formatter --save
Specify date and format data attributes on all HTML elements you want
formatted:
<span data-date="Thu Apr 07 2016 17:00:00 GMT-0700 (PDT)" data-format="%Y-%m-%d">
(any textContent you put here will be replaced with "2016-04-07")
</span>
The date data attribute should be a stringified representation of a JavaScript Date
object,
e.g. String(new Date())
The format data attribute is optional. If omitted, a human-friendly relative date
string like "5 minutes ago" is displayed. If specified, the format is expected
to be a strftime pattern, such as %Y-%m-%d.
Require and invoke the function in your javascript code:
require('browser-date-formatter')()
When the DOM is ready, this module finds all elements with a data-date
attribute and converts their text content to the given data-format. The
formatter function is executed every 5 seconds to keep relative dates fresh.
If you're not using browserify in your project, you can use the unpkg.com hosted version instead:
<script src="https://unpkg.com/browser-date-formatter/dist.js"></script>
<script>
browserDateFormatter()
</script>
npm install
npm test
MIT
Generated by package-json-to-readme
FAQs
Format dates real fancy-like in the browser. Good for search engines and humans.
We found that browser-date-formatter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.

Product
Socket is now scanning AI agent skills across multiple languages and ecosystems, detecting malicious behavior before developers install, starting with skills.sh's 60,000+ skills.

Product
Socket now supports PHP with full Composer and Packagist integration, enabling developers to search packages, generate SBOMs, and protect their PHP dependencies from supply chain threats.