# nyc-lib

> A set of common libraries used to develop NYC mapping applications

Latest version **1.4.89** (published 2024-01-18) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install nyc-lib
pnpm add nyc-lib
yarn add nyc-lib
bun add nyc-lib
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.89 |
| Published | 2024-01-18 |
| First published | 2018-06-26 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.2.4 |
| Dependencies | 10 |
| Unpacked size | 10.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 12 |
| Author | Tim Keane |
| Maintainers | timkeane, cmenedes |
| Keywords | mapping, openlayers, nyc, New York |

## Links

- npm: https://www.npmjs.com/package/nyc-lib
- Repository: https://github.com/timkeane/nyc-lib
- Homepage: https://github.com/timkeane/nyc-lib#readme
- Issues: https://github.com/timkeane/nyc-lib/issues
- npm.io page: https://npm.io/package/nyc-lib

## Dependencies (10)

- [ol](https://npm.io/package/ol.md) 8.2.0
- [proj4](https://npm.io/package/proj4.md) ^2.4.4
- [global](https://npm.io/package/global.md) ^4.4.0
- [jquery](https://npm.io/package/jquery.md) ^3.5.0
- [papaparse](https://npm.io/package/papaparse.md) ^5.3.0
- [shapefile](https://npm.io/package/shapefile.md) ^0.6.6
- [node-fetch](https://npm.io/package/node-fetch.md) ^3.1.1
- [ol-mapbox-style](https://npm.io/package/ol-mapbox-style.md) ^12.1.1
- [isomorphic-fetch](https://npm.io/package/isomorphic-fetch.md) ^3.0.0
- [simple-statistics](https://npm.io/package/simple-statistics.md) ^7.0.8

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 1.4.89 (latest) — 2024-01-18
- 1.4.88 — 2024-01-11
- 1.4.87-debug — 2024-01-09
- 1.4.87 — 2024-01-05
- 1.4.86 — 2024-01-05
- 1.4.85 — 2023-12-29
- 1.4.84 — 2023-12-28
- 1.4.83 — 2023-12-27
- 1.4.82 — 2023-12-22
- 1.4.81 — 2023-12-22
- 1.4.80 — 2023-01-30
- 1.4.79 — 2023-01-30
- 1.4.78 — 2023-01-26
- 1.4.77 — 2023-01-26
- 1.4.76 — 2023-01-26
- … 292 more at https://npm.io/package/nyc-lib/versions

## README

# nyc-lib

[![Build Status](https://travis-ci.org/timkeane/nyc-lib.svg?branch=master)](https://travis-ci.org/timkeane/nyc-lib) [![Coverage Status](https://coveralls.io/repos/github/timkeane/nyc-lib/badge.svg?branch=master)](https://coveralls.io/github/timkeane/nyc-lib?branch=master) 
#### [GitHub Repo](https://github.com/timkeane/nyc-lib)

*nyc-lib* is a set of common libraries used to develop NYC mapping applications

### [Documentation and Examples](https://maps.nyc.gov/nyc-lib/)

### Using with Node.js

* `yarn add nyc-lib && yarn global add postcss-cli`

#### Required external dependencies

The following libraries are extenal requiremnents that must be included separately in your build or in your HTML page:
* proj4
* ol
* jquery

#### Optional external dependencies 

The following libraries are extenal requiremnents that may be optionally included separately depending on desired functionality:
* shapefile
* papaparse
* leaflet

### Adding to package.json

```
{
  ...
  "dependencies: {
    ...
    "nyc-lib": "^@@VERSION@@"
    ...
  }
  ...
}
```

### Using in an HTML page

Note: If you plan on load testing an application that uses this library you must do so using a staging URL provided by the DoITT GIS Unit 

```
<link href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.5.0/css/ol.css" rel="stylesheet">
<link href="https://maps.nyc.gov/nyc-lib/@@VERSION@@/css/nyc-ol-lib.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.4.4/proj4.js"></script>
<script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v7.1.0/build/ol.js"></script>
<script src="https://maps.nyc.gov/nyc-lib/@@VERSION@@/js/nyc-ol-lib.js"></script>
```

### Building

* Set environment variable `NODE_ENV` to `dev`, `stg`, or `prd`
* Until webpack and dependencies are upgraded `export NODE_OPTIONS=--openssl-legacy-provider`
* If you plan on load testing an application that uses this library you must do so using a staging build
* Once the environment is set run `yarn build`

### Geocoding

* To use `nyc.Geoclient` as the implementation of `nyc.Geocoder` you must first get your Geoclient App ID and App Key from the [NYC Developer Portal](https://api-portal.nyc.gov/docs/services/geoclient/operations/geoclient)
  * Register if you don't have an NYC Developer Portal account
  * Developer Management > View or Create a New Project...
* If you work for NYC you may contect the DoITT GIS unit for your App ID and App Key to use a DoITT hosted and supported version of Geoclient

---
_Source: https://npm.io/package/nyc-lib · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
