
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
excel-style-dataformatter
Advanced tools
#Excel-Style Javascript Data Formatter
##Current version supports
#Usage
##CommonJS
npm install excel-style-dataformatter
import dataFormatter from 'excel-style-dataformatter';
const result = dataFormatter.format('99', 'Number', 'Currency');
####Creating your own instance
import { DataFormatter } from 'excel-style-dataformatter';
const options = { debug: true };
const dataFormatter = new DataFormatter(options);
const result = dataFormatter.format('123', 'Number', '[Red]0;[Green]0.0');
####Available options
debug {boolean}
locale {string}
transformCode {function}
UTCOffset {number|null} - UTC offset for dates in minutes
##Browser
<!DOCTYPE html>
<html>
<head>
<script src="dist/excel-style-dataformatter.js"></script>
</head>
<body>
<script>
var result = dataFormatter.format('2013-05-22T13:19:59.000','DateTime','yyyy mm dd');
document.write(result.value);
// Creating your own instance
var myDataFormatter = new DataFormatter({ debug: true });
var myResult = myDataFormatter.format('13.4', 'Number', 'General');
document.write(myResult.value);
</script>
</body>
</html>
##AMD
<!DOCTYPE html>
<html>
<head>
<script src="require.js"></script>
</head>
<body>
<script>
require(['dist/excel-style-dataformatter.js'], function() {
require(['dataFormatter', 'DataFormatter'], function(dataFormatter, DataFormatter) {
var result = dataFormatter.format('Test', 'String', '[>100][Red]0.0;[>10][Green]-0;[Blue]"Zero";@');
document.write(result.value);
// Creating your own instance
var myDataFormatter = new DataFormatter({ debug: true });
var myResult = myDataFormatter.format('0', 'Number', 'Yes/No');
document.write(myResult.value);
});
});
</script>
</body>
</html>
FAQs
Excel-Style Javascript Data Formatter
The npm package excel-style-dataformatter receives a total of 1,663 weekly downloads. As such, excel-style-dataformatter popularity was classified as popular.
We found that excel-style-dataformatter 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.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.