ertu-js-utils
v1.1.1
Published
Utility functions for JavaScript | Typescript
Downloads
16
Readme
ertu-js-utils
A collection of utility functions for data validation and date formatting. | ------------------------------------------------------ |
Installation
You can install this package in your project using npm
:
npm install ertu-js-utils
Usage
isNull
Usage example
const { isNull } = require('ertu-js-utils');
console.log(isNull(null)); // true
console.log(isNull(5)); // false
formatCreatedAt
Usage example
const { formatCreatedAt } = require('ertu-js-utils');
const date = '2023-10-17T12:34:56Z';
console.log(formatCreatedAt(date, 'en-US', true)); // 10/17/2023, 12:34 PM GMT
console.log(formatCreatedAt(date, 'tr-TR'));
isNumber
Usage example
const { isNumber } = require('ertu-js-utils');
console.log(isNumber(123)); // true
console.log(isNumber("456")); // true
console.log(isNumber("456a")); // false
console.log(isNumber("abc")); // false
console.log(isNumber(null)); // false
License
MIT