open-index/open-npm huggingface dataset:
npm package: @joergdietrich/leaflet.terminator
Description: Night and day regions on Earth
Author: Jörg Dietrich
Latest version: 1.3.0

Leaflet.Terminator
==================

Overlay day and night regions on a Leaflet Earth map.

Demo: http://joergdietrich.github.io/Leaflet.Terminator/

Leaflet.Terminator extends the Polygon class. Adding the terminator to a leaflet map is as easy as 

```html
<script src="https://unpkg.com/leaflet"></script>
<script src="https://unpkg.com/@joergdietrich/leaflet.terminator"></script>
```
```js
var map = L.map('map').addLayer(L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'));
L.terminator().addTo(map)
```

Or with npm:

```js
import L from 'leaflet';
import terminator from '@joergdietrich/leaflet.terminator';

var map = L.map('map').addLayer(L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'))
terminator().addTo(map);
```


In addition to all Polygon options, Leaflet.Terminator has a new
option `resolution`, which gives the step size at which the terminator
points are computed. The step size is 1°/resolution, i.e. higher
resolution values have smaller step sizes and more points in the
polygon. The default value is 2.

Leaflet.Terminator computes the terminator from longitudes -360° to +360°
(a range of 720°), covering the Earth twice. To limit the terminator
longitude range, the `longitudeRange` option is available.

```js
var sunlightOverlay = L.terminator({resolution: 5, longitudeRange:360});
```

You can pass the `time` option in the constructor or use the `setTime()`
method to control the reference time and date for the terminator; the
value can be anything accepted by the `Date()` constructor. By default,
the current time will be used.

In the same way, you can use the `setTime()` method without an argument
to refresh the terminator to the current time. This can be done
automatically, for example using a timer:

```js
var map = L.map('map').addLayer(L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'));
var terminator = L.terminator().addTo(map);
setInterval(function() {
	terminator.setTime();
}, 60000); // Every minute

```

If you don't like background timers running even when the page is
inactive, you can also set the terminator to be refreshed only when the
user interacts with the map:

```js
var map = L.map('map').addLayer(L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'));
var terminator = L.terminator().addTo(map);
map.addEventListener('zoomstart movestart popupopen', function(e) {
	terminator.setTime();
});
```

You can customize and complete this code by listing
additional map interaction events, described in the Leaflet
[documentation](https://leafletjs.com/reference.html#map-event).
npm package: @joergenbye/react-scripts-office-js
Description: Configuration and scripts for Create React App.
Latest version: 1.0.18

# react-scripts

This package includes scripts and configuration used by [Create React App](https://github.com/facebookincubator/create-react-app).<br>
Please refer to its documentation:

* [Getting Started](https://github.com/facebookincubator/create-react-app/blob/master/README.md#getting-started) – How to create a new app.
* [User Guide](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md) – How to develop apps bootstrapped with Create React App.
npm package: @joeriess/tsconfig
Description: TypeScript configuration file for all my projects
Author: Joe Riess
Latest version: 1.0.0

# tsconfig

> Shared [TypeScript configuration file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) for my projects

## Install

```bash
npm install --save-dev @joeriess/tsconfig
```

## Usage

To use this configuration you can simply `extend` from it:

```json
{
  "extends": "@joeriess/tsconfig",
  "compilerOptions:": {
    "outDir": "dist"
  }
}
```
npm package: @joern.kalz/nest-test-setup
Description: Convenient test setup for Nest
Author: joern.kalz
Latest version: 0.1.3

# @joern.kalz/nest-test-setup

Convenient setup of testing modules for [Nest](https://nestjs.com/) applications.

## Motivation

Setting up a testing module including mocks in a Nest applications usually requires some boilerplate code. 

This package provides a concise way for defining a testing modules.

## Installation

```sh
npm i -D @joern.kalz/nest-test-setup
```

or

```sh
yarn add -D @joern.kalz/nest-test-setup
```

In the `jest` section of your `package.json` change the entry `testEnvironment` to:

```json
"testEnvironment": "../node_modules/@joern.kalz/nest-test-setup/env.js"
```

## Usage

### Unit Testing Controllers

With a controller depending on a service

```typescript
// my.controller.ts

@Controller()
export class MyController {
  constructor(private readonly myService: MyService) {}
  @Get()
  getGreeting(): string {
    return this.myService.getGreetingText();
  }
}

// my.service.ts

@Injectable()
export class MyService {
  getGreetingText(): string {
    return "Hello!";
  }
}
```

You can test `MyController` with

```typescript
import {
  controller,
  createTestingModule,
  mockProvider,
} from "@joern.kalz/nest-test-setup";

describe("setup", () => {
  const myController = controller(AppController);
  const myServiceMock = mockProvider(AppService);
  beforeEach(createTestingModule);

  it("should create test module", () => {
    myServiceMock.getGreeting.mockReturnValue("Hello world");
    expect(myController.getHello()).toBe("Hello world");
  });
});
```

### Unit Testing Services

With a service depending on another service

```typescript
// my.service.ts

@Injectable()
export class MyService {
  constructor(private readonly myOtherService: MyOtherService) {}
  getGreetingText(): string {
    return `Hello ${this.myOtherService.getName()}`;
  }
}

// my.other.service.ts

@Injectable()
export class MyOtherService {
  getName(): string {
    return "all";
  }
}
```

You can test `MyService` with

```typescript
import {
  createTestingModule,
  mockProvider,
  provider,
} from "@joern.kalz/nest-test-setup";

describe("setup", () => {
  const myService = provider(MyService);
  const myOtherServiceMock = mockProvider(MyOtherService);
  beforeEach(createTestingModule);

  it("should create test module", () => {
    myOtherServiceMock.getName.mockReturnValue("world");
    expect(myService.getGreetingText()).toBe("Hello world");
  });
});
```

## Contribute

Contributions welcome!