Socket
Socket
Sign inDemoInstall

javascript-time-ago

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

javascript-time-ago - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

4

load-all-locales.js

@@ -0,1 +1,3 @@

// This file is in ES5 syntax to allow for older versions of Node.js
var path = require('path')

@@ -7,3 +9,3 @@ var fs = require('fs')

var locale = file.replace(/\.js$/, '')
javascript_time_ago.locale(require('./locales/' + locale))
javascript_time_ago.locale(require(path.resolve(__dirname, 'locales', locale)))
})
{
"name": "javascript-time-ago",
"version": "0.3.0",
"version": "0.3.1",
"description": "International highly customizable relative time formatting",

@@ -5,0 +5,0 @@ "main": "index.umd.js",

@@ -257,2 +257,17 @@ # javascript-time-ago

## Loading locales
No locales are loaded by default. This is done to allow tools like Webpack take advantage of code splitting to reduce the resulting javascript bundle size.
But server side doesn't need code splitting, so to load all available locales in Node.js you can use this shortcut:
```js
import javascript_time_ago from 'javascript-time-ago'
// A faster way to load all the localization data for Node.js
// (`intl-messageformat` will load everything automatically when run in Node.js)
global.javascript_time_ago = javascript_time_ago
require('javascript-time-ago/load-all-locales')
```
## Customization

@@ -259,0 +274,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