Skip to main content
This release is 2 versions behind 0.0.5 — the latest version of @ayame113/temporarily. Jump to latest

This library provides a date string parser for use with the Temporal API.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
9 months ago (0.0.3)

temporarily

Datetime parser for Temporal API.

// main.ts
import { parse } from "./mod.ts";

const parsed = parse("2024-05-03 15:25:29", "%Y-%m-%d %H:%M:%S");
console.log(parsed); // { year: 2024, month: 5, day: 3, hour: 15, minute: 25, second: 29 }

const date = Temporal.PlainDateTime.from(parsed);
console.log(date); // Temporal { 2024-05-03T15:25:29 }
deno run --unstable-temporal ./main.ts

Add Package

deno add jsr:@ayame113/temporarily

Import symbol

import * as temporarily from "@ayame113/temporarily";

---- OR ----

Import directly with a jsr specifier

import * as temporarily from "jsr:@ayame113/temporarily";

Add Package

npx jsr add @ayame113/temporarily

Import symbol

import * as temporarily from "@ayame113/temporarily";

Add Package

yarn dlx jsr add @ayame113/temporarily

Import symbol

import * as temporarily from "@ayame113/temporarily";

Add Package

pnpm dlx jsr add @ayame113/temporarily

Import symbol

import * as temporarily from "@ayame113/temporarily";

Add Package

bunx jsr add @ayame113/temporarily

Import symbol

import * as temporarily from "@ayame113/temporarily";