From f32ac70832d5a23bbb43b5a96504d4e8ac191f3b Mon Sep 17 00:00:00 2001 From: Kato Twofold Date: Sat, 7 May 2022 15:16:53 +0300 Subject: [PATCH] + ReadME Updates --- README.md | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8b79dd8..b236790 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,40 @@ Using npm: ```shell $ npm i tymejs ``` -In Node.js: -```js +In Node.js TypeScript: +```js +// Import the Package +import TymeJS from "tymejs"; // Use require for plain javascript + +// Get the date object from Somewhere +let myDate: Date = new Date(); + +// Initialize the TymeJS Object +let t: TymeJS = new TymeJS(myDate); + +// Now you can format different dates +let formattedDate: string = t.format("d/m/Y H:i A"); + +// Log the formatted Date +console.log(formattedDate); +``` + +In Node.js using JavaScript: +```js +const { default: TymeJS } = require("tymejs"); + +// Get the date object from Somewhere +let myDate = new Date(); + +// Initialize the TymeJS Object +let t = new TymeJS(myDate); + +// Now you can format different dates +let formattedDate = t.format("d/m/Y H:i A"); + +// Log the formatted Date +console.log(formattedDate); ``` ## Why TymeJS?