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

@warsawlo/edu-establishments

v0.0.2

Published

Tiny API wrapper for educational layer of Warsaw Map Service (https://mapa.um.warszawa.pl)

Downloads

11

Readme

edu-establishments

Tiny API wrapper for educational layer of Warsaw Map Service (https://mapa.um.warszawa.pl)

Installation


yarn add @warsawlo/edu-establishments

or


npm i -S @warsawlo/edu-establishments

Getting started


import Establishments  from  '@warsawlo/edu-establishments'

const establishments = new Establishments()

establishments.findAll().then(res => {})

establishments.findByDistrict(district).then(res => {})

establishments.findByName(name).then(res => {})

establishments.findByNameAndType(name, type).then(res => {})

establishments.findByStreetAndNumber(street, number).then(res => {})

establishments.responseType = 'stream' // default: json

establishments.useTransformer(transformer)
// transformer is a function invoked under the hood by axios` transformResponse

Quite important!

Before using API resources of The City of Warsaw check this reuse terms (PL only) You can find all (not only educational) API spec here (PL only)

API Reference

All functions (except setTranformer) provide data in GeoJSON format

new Establishments(reference)

| Param | Type | Default value | Description | | - | - | - | - | | reference | string | pl2000 | Sets coordinate system. It can be pl2000 or wgs84.

Returns Establishments instance.

.findAll()

Get all educational establishments in Warsaw.

Returns promise from the axios call

.findByName(name)

Find educational establishments by establishment's name.

| Param | Type | Description | | - | - | - | | name | String | Establishment name

Returns promise from the axios call

.findByNameAndType(name, type)

Find educational establishments by establishment's name and type.

| Param | Type | Description | | - | - | - | | name | String | Establishment's name | type | String | Establishment's type See list of types

Returns promise from the axios call

.findByDistrict(district)

Find educational establishments by establishment's name and type.

| Param | Type | Description | | - | - | - | | district | String | District which given establishments is located in (List of districts of Warsaw)

Returns promise from the axios call

.findByStreetAndNumber(street, number)

Find educational establishments by establishment's address.

| Param | Type | Description | | - | - | - | | street | String | Street where establishment is located | number | String | House number where the school is located

Returns promise from the axios call

.useTransformer(transformer)

Set axios' transformResponse function

| Param | Type | Description | | - | - | - | | transformer | Function | Street where establishment is located

    const removeTranformer = instance.useTransformer(data => {
        return `Data object keys: ${Object.keys(data).join(', ')}`
    })

    removeTransformer()

Returns a function that removes current transformer

.responseType

Set response type (arraybuffer, document, json, text, stream).

Default: json

List of types

| Type | | :-- | | przedszkole | | szkoła podstawowa | | gimnazjum | | liceum | | liceum ogólnokształcące | | liceum dla dorosłych | | technikum | | szkoła branżowa I stopnia | | szkoła policealna | | bursa internat | | młodzieżowy dom kultury | | poradnia psychologiczno-pedagogiczna | | specjalistyczna poradnia psychologiczno-pedagogiczna |