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 🙏

© 2024 – Pkg Stats / Ryan Hefner

my-school-list

v1.1.0

Published

Library for fetching list of schools in Malaysia based on States & District.

Downloads

14

Readme

MY-School-List

Library for fetching list of schools in Malaysia based on States & District.

Data taken from Ministry of Education Malaysia (Date release: January 2020)

Skeleton taken from harpreetkhalsagtbit's country-state-city

Install

npm i my-school-list

Usage

  • ES6 Module usage

    import MSL from 'my-school-list'

Golang version

  • Thanks to @svicknesh.
  • Install this package using go get github.com/svicknesh/myschoollist
  • Link : https://github.com/svicknesh/myschoollist

Docs

getStateById(id)

It accepts a valid id eg: '1' and returns State Details

type: json

{
    "id": "1",
    "shortname": "JHR",
    "name": "Johor",
    "iso": "MY-01"
}

getStateByShortname(code)

It accepts a valid shortname eg: 'JHR' and returns State Details

type: json

{
    "id": "1",
    "shortname": "JHR",
    "name": "Johor",
    "iso": "MY-01"
}

getDistrictById(id)

It accepts a valid id eg: '2'and returns District Details

type: json

{
    "id": "2",
    "name": "PPD MANJUNG",
    "state_id": "8"
}

getSchoolByCode(schoolcode)

It accepts a valid schoolcode eg: 'YEE6101'and returns School Details

type: json

{
    "id": "10153",
    "district_id": "136",
    "name": "SEKOLAH MENENGAH KEBANGSAAN SG PAOH",
    "schoolcode": "YEE6101",
    "level": "Menengah",
    "address": "PETI SURAT 160",
    "postcode": "96107",
    "city": "SARIKEI",
    "email": "**REDACTED**",
    "coordinatexx": "111.46735",
    "coordinateyy": "2.021566667"
}

getDisctrictOfState(state_id)

It accepts a valid state_id and returns District Details

type: json

[{
    "id": "1",
    "name": "PPD BATANG PADANG",
    "state_id": "8"
},
{
    "id": "2",
    "name": "PPD MANJUNG",
    "state_id": "8"
},
{
    "id": "3",
    "name": "PPD KINTA UTARA",
    "state_id": "8"
},
{
    "id": "4",
    "name": "PPD KINTA SELATAN",
    "state_id": "8"
} ... ]

getSchoolsOfDisctrict(district_id)

It accepts a valid district_d e.g: '1' and returns School Details

type: json

[{
    "id": "1",
    "district_id": "1",
    "name": "SEKOLAH KEBANGSAAN TOH TANDEWA SAKTI",
    "schoolcode": "ABA0001",
    "level": "Rendah",
    "address": "JALAN KELAB",
    "postcode": "35000",
    "city": "TAPAH",
    "email": "**REDACTED**",
    "coordinatexx": "101.255932",
    "coordinateyy": "4.196633"
},
{
    "id": "2",
    "district_id": "1",
    "name": "SEKOLAH KEBANGSAAN PENDITA ZA'BA",
    "schoolcode": "ABA0002",
    "level": "Rendah",
    "address": "JALAN TAPAH ROAD",
    "postcode": "35400",
    "city": "TAPAH ROAD",
    "email": "**REDACTED**",
    "coordinatexx": "101.2006171",
    "coordinateyy": "4.178275806"
} ...]

getAllStates()

It returns all States

type: array of json

[
    {
		"id": "1",
		"sortname": "JHR",
		"name": "Johor",
		"iso": "MY-01"
	},
	{
		"id": "2",
		"sortname": "KDH",
		"name": "Kedah",
		"iso": "MY-02"
	},
	{
		"id": "3",
		"sortname": "KTN",
		"name": "Kelantan",
		"iso": "MY-03"
	}...
]

Change Logs

v1.0.0

  1. Initial commit.

v1.0.1

  1. Redacted email addresses from the example codes
  2. Added new funtion getSchoolByCode
  3. Edited README.md to reflect new changes

v1.0.2

  1. Change sortname identifier in state.json to shortname //Thanks Vicknesh!
  2. Introduce a new method getStateByShortname

v1.1.0

  1. Updating the school list school.json based on latest data from MoE (January 2020)
  2. Take note that with this update, id for each school is different from the previous version. Potentially breaking changes, if you refer the school id in your code from version 1.0.2.