npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

arkib

v0.0.12

Published

Unofficial client API for National Archives of Malaysia (Arkib Negara)

Readme

Arkib

Unofficial client API for National Archives of Malaysia (Arkib Negara)

Features

☑️ Promise-based

Getting Started

Install using npm

npm install arkib

Usage

Using promise

const arkib = require('arkib')

arkib.getEventToday()
  .then(res => console.log(res))
  .catch(err => console.error(err));

Using async/await

const arkib = require('arkib')

(async () => {
  try {
    const historyToday = await arkib.getEventToday();
    console.log(historyToday);
  } catch (err) {
    console.error(err);
  }
})();

Example response

{
  id: 4196,
  title_bm: 'PEMINDAHAN KUASA NEGERI-NEGERI SELAT DARI INDIA KE PEJABAT TANAH JAJAHAN DI LONDON',
  title_eng: 'TRANSFER OF AUTHORITY OF THE STRAITS SETTLEMENT FROM INDIA TO THE COLONIAL OFFICE IN LONDON',
  description_bm: 'Pada hari ini dalam tahun 1867, Pejabat Tanah Jajahan London...',
  description_eng: 'On this day in 1867, the London Colonial Office...',
  script_date: '01/04/1867',
  lkp_era_id: null,
  lkp_sub_era_id: null,
  lkp_source_id: null,
  upload_date: null,
  display_date: '1867-04-01',
  lkp_process_status_id: 4,
  lkp_status_id: null,
  version: '1.0',
  created_at: '2019-09-06 07:01:55',
  updated_at: '2019-09-06 07:02:15',
  deleted_at: null,
  rate: null,
  day: 'Isnin',
  script_day: '1',
  script_month: '4'
}

Available methods

getEventToday()

Descriptions

This method will return Javascript object of one today's historical moment. It based on your server's timezone. Return: Javascript Object

Note: Sometimes, there is no english version of title and description.

Example Response:
{
  id: 4196,
  title_bm: 'PEMINDAHAN KUASA NEGERI-NEGERI SELAT DARI INDIA KE PEJABAT TANAH JAJAHAN DI LONDON',
  title_eng: 'TRANSFER OF AUTHORITY OF THE STRAITS SETTLEMENT FROM INDIA TO THE COLONIAL OFFICE IN LONDON',
  description_bm: 'Pada hari ini dalam tahun 1867, Pejabat Tanah Jajahan London...',
  description_eng: 'On this day in 1867, the London Colonial Office...',
  script_date: '01/04/1867',
  lkp_era_id: null,
  lkp_sub_era_id: null,
  lkp_source_id: null,
  upload_date: null,
  display_date: '1867-04-01',
  lkp_process_status_id: 4,
  lkp_status_id: null,
  version: '1.0',
  created_at: '2019-09-06 07:01:55',
  updated_at: '2019-09-06 07:02:15',
  deleted_at: null,
  rate: null,
  day: 'Isnin',
  script_day: '1',
  script_month: '4'
}

getAllEventsToday()

Description

This method will return an array of Javascript object of all today's historical moment. It based on your server's timezone. Return: Array of Javascript Object

Note: Sometimes, there is no english version of title and description.

Example Response
[
  {
    no: 0,
    day: 'Isnin',
    script_date: '01/04/1867',
    description_bm: 'Pada hari ini dalam tahun 1867...',        
    id: 4196,
    title_bm: 'PEMINDAHAN KUASA NEGERI-NEGERI SELAT DARI INDIA KE PEJABAT TANAH JAJAHAN DI LONDON',
    title_eng: 'TRANSFER OF AUTHORITY OF THE STRAITS SETTLEMENT FROM INDIA TO THE COLONIAL OFFICE IN LONDON',
    lkp_era_id: null,
    lkp_sub_era_id: null,
    lkp_source_id: null,
    upload_date: null,
    display_date: '1867-04-01',
    lkp_process_status_id: 4,
    lkp_status_id: null,
    version: '1.0',
    created_at: '2019-09-06 07:01:55',
    updated_at: '2019-09-06 07:02:15',
    deleted_at: null,
    rate: null
  },
  {
    no: 1,
    day: 'Isnin',
    script_date: '01/04/1929',
    description_bm: 'Pada hari ini dalam tahun 1929...',
    description_eng: 'On this day in 1929...',
    id: 2337,
    title_bm: 'SEKOLAH PERGURUAN KOTA BAHARU DIBUKA',
    title_eng: 'KOTA BAHARU TEACHERS TRAINING SCHOOL OPENED',
    lkp_era_id: null,
    lkp_sub_era_id: null,
    lkp_source_id: null,
    upload_date: null,
    display_date: '1929-04-01',
    lkp_process_status_id: 4,
    lkp_status_id: null,
    version: '1.0',
    created_at: '2019-09-06 07:01:34',
    updated_at: '2019-09-06 07:01:34',
    deleted_at: null,
    rate: null
  }
]

getEventByDate(day: number, month: number)

Description

This method will return a Javascript object of one historical event specified by date. Return: Javascript Object

Note: Sometimes, there is no english version of title and description.

Example Usage
// Get one event on 1st January
arkib.getEventByDate(1, 1);

getAllEventsByDate(day: number, month: number)

Description

This method will return an array of Javascript object of all historical event specified by date. Return: Array of Javascript Object

Note: Sometimes, there is no english version of title and description.

Example Usage
// Get all events on 29th February
arkib.getAllEventsByDate(29, 2);

getVideoDetails(id: number, language: 'bm' | 'eng', options?: DownloadVideo | undefined)

// Pass options if you want to download video
options = {
  savePath: string;
  fileName: string;
}

Description

This method will return Javascript object of the video details. Return: Javascript Object

Note: This method messed up a little because the 'id' is not consistant and we don't know which id get 200 OK, which id get 500 Internal Server Error

Example Usage
// Get video details for malay version without downloading the video
arkib.getVideoDetails(3, 'bm');

downloadVideo(id: number, savePath: string, fileName: string)

Description

This method will return string of the downloaded video path in your pc. Return: string

Note: This method messed up a little because the 'id' is not consistant and we don't know which id get 200 OK, which id get 500 Internal Server Error

Example Usage
// This will return D:/this_is_filename.mp4
arkib.downloadvideo(3, 'D:/', 'this_is_filename');

License

This project is licensed under the MIT License