@star-insure/sdk
TypeScript icon, indicating that this package has built-in type declarations

5.0.5 • Public • Published

Star Insure - SDK

The SDK for Star Insure client apps with shared helper functions and TypeScript definitions.

Installation

npm install @star-insure/sdk

Development

npm start

Testing

npm run test

Publishing to NPM

Suggest that you use np for publishing.

From the command line just run (you'll need Node version 18+ running):

npm run publish

Usage

This library provides the following functions:

Date and Time

  1. formatDate - Returns a string in format dd/mm/yyyy
import { formatDate } from '@star-insure/sdk';

formatDate(new Date());
formatDate('2024-03-23T20:00:00.000Z');
formatDate('Sat, 23 Mar 2024 20:00:00 GMT');
  1. formatDateTime - Returns a string in format dd/mm/yyyy hh:mm (24-hour clock)
import { formatDateTime } from '@star-insure/sdk';

formatDateTime(new Date());
formatDateTime('2024-03-23T20:00:00.000Z');
formatDateTime('Sat, 23 Mar 2024 20:00:00 GMT');

Money

  1. formatMoney - Returns a string in format $x,xxx.xx
import { formatMoney } from '@star-insure/sdk';

formatMoney(1234567.89);
formatMoney('1234567.89');

Readme

Keywords

none

Package Sidebar

Install

npm i @star-insure/sdk

Weekly Downloads

284

Version

5.0.5

License

MIT

Unpacked Size

979 kB

Total Files

206

Last publish

Collaborators

  • carlostarinsure
  • nzbasic
  • alexclark