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

@encodable/format

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@encodable/format - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

6

package.json
{
"name": "@encodable/format",
"version": "1.0.2",
"version": "1.0.3",
"description": "Utilities for managing time and number formats.",

@@ -33,3 +33,3 @@ "sideEffects": false,

"dependencies": {
"@encodable/registry": "^1.0.2",
"@encodable/registry": "^1.0.3",
"@types/d3-format": "^1.3.1",

@@ -42,3 +42,3 @@ "@types/d3-time": "^1.0.10",

},
"gitHead": "76988b00f9b22c22fbe0ba660b0f4bd4438df7ed"
"gitHead": "03981d54b94928eec00c47bec02930f0d7b62ad6"
}

@@ -15,29 +15,4 @@ ## @encodable/format

### Example usage
### Documentation
```ts
import {
getTimeFormat,
formatTime,
getNumberFormat,
formatNumber,
getNumberFormatterRegistry,
} from '@encodable/format';
// Get number format function
const numFormatFn = getNumberFormat('.2f');
// Get time format function
const timeFormatFn = getTimeFormat('%Y-%m-%d');
// or just format directly
formatNumber('.2f', 200); // 200.00
formatTime('%Y-%m-%d', new Date()); // 2020-08-15
// can customize by adding your own formatters
// or override the d3 ones
getNumberFormatterRegistry().registerValue('my-format', (x) => `haha:${x}`);
formatNumber('my-format', 200); // haha:200
```
[See documentation and more examples here.](https://encodable.vercel.app/encodable-format)
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