Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deno_erajp

Deno porting of go-erajp.
Deno modules for japanese era.
(日本の元号を扱う為のライブラリであるgo-erajpをDeno向けに移植したものです。)

Usage

// example.ts
import { toEraFromTime } from "./mod.ts";

console.log(toEraFromTime(new Date())); // 令和
console.log(toEraFromTime(new Date("2019/5/1"))); // 令和
console.log(toEraFromTime(new Date("2019/4/30"))); // 平成

--allow-read option needs to be added.

deno run --allow-read example.ts

Test

deno test --allow-read

If the version is older than 1.18, add --unstable.

deno test --allow-read --unstable

Thank you

The implementation in this repository is a port of the implementation in this repository (go-erajp) for Deno.

Licence

MIT

The Licence is MIT, according to the license of go-erajp.

About

Deno porting of https://github.com/mattn/go-erajp

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages