open-index/open-npm huggingface dataset:
npm package: @mmit/latlong
Description: Lightweight library for common latitude and longitude calculation
Author: Mike Mitterer
Latest version: 0.2.10

# LatLong - Lightweight library for common latitude and longitude calculation
> [Live-Example](#) | [GitHub-Home](https://github.com/MikeMitterer/ts-latlong)

This library supports both, the "Haversine" and the "Vincenty" algorithm.

"Haversine" is a bit faster but "Vincenty" is far more accurate!
 
<p align="center"> 
    <img alt="LatLong" src="https://github.com/MikeMitterer/ts-latlong/raw/master/doc/images/latlong.jpg"> 
</p>

[Catmull-Rom algorithm](http://hawkesy.blogspot.co.at/2010/05/catmull-rom-spline-curve-implementation.html) is used for smoothing out the path.

## Basic usage 

### Distance
```typescript
    const distance = new Distance();
    
    // km = 423
    const km = distance.as(LengthUnit.Kilometer,
     new LatLng(52.518611,13.408056),new LatLng(51.519475,7.46694444));
    
    // meter = 422591.551
    const meter = distance.distance(
        new LatLng(52.518611,13.408056),
        new LatLng(51.519475,7.46694444)
        );

```

## Offset
```typescript
    const distance = new Distance();
    const distanceInMeter = Math.round(EARTH_RADIUS * Math.PI / 4));
    
    const p1 = new LatLng(0.0, 0.0);
    const p2 = distance.offset(p1, distanceInMeter, 180);
    
    // LatLng(latitude:-45.219848, longitude:0.0)
    console.log(p2.round());
    
    // 45° 13' 11.45" S, 0° 0' 0.00" O
    console.log(p2.toSexagesimal());
            
```

## Path smoothing
```typescript
    // zigzag is a list of coordinates
    const path = new Path.from(zigzag);
    
    // Result is below
    const steps = path.equalize(8,smoothPath: true);
```
<p align="center"> 
    <img alt="Smooth path" src="https://github.com/MikeMitterer/ts-latlong/raw/master/doc/images/smooth-path.jpg">
</p>

For more - check out my tests
npm package: @mmit/logging
Description: Minimal Logging framework
Author: Mike Mitterer
Latest version: 0.1.15

# Minimal TS Logging framework 
> [Live-Example]() | [GitHub-Home](https://github.com/MikeMitterer/ts-logging)

Very simple but extendable logger in TypeScript.

For now there are only two loggers define: `ConsoleLogger` and `NoOpLogger` but it
should be easy to define your own logger

## Install

    # NPM
    npm install @mmit/logging
    
    # YARN
    yarn add @mmit/logging
        
## Usage

The "default LogLevel" is 'INFO'

The most simplest way to get the logger is:

```typescript
    import { LoggerFactory } from '@mmit/logging';

    const logger = LoggerFactory.getLogger('test.Logger');
    
    // Will not be shown
    logger.debug("Shows message only if debug-level is set!");

    // Will not be shown
    logger.info("Shows message only if info-level is set!");

    // Shows the warning message 
    logger.warn("Shows message only if warn-level is set!");
```

If you need more control:

```typescript
    import { LoggerFactory, LogLevel } from '@mmit/logging';

     const logger = LoggerFactory.for('test.Logger')
                .level(LogLevel.DEBUG)
                .get();
    
    // Will be shown
    logger.debug("Shows message only if debug-level is set!");

    // Will be shown
    logger.info("Shows message only if info-level is set!");

    // Will be shown
    logger.warn("Shows message only if warn-level is set!");
```

If you want to specify your own Log-Channel:

```typescript
    import { LoggerFactory, LogLevel, Channel } from '@mmit/logger';

    class MyCoolLogChannel implements Channel {
        ...
    }

    const myChannel = new MyCoolLogChannel();
    
    const logger = LoggerFactory.for('test.Logger')
                .on(myChannel)
                .level(LogLevel.DEBUG)
                .get();
    
    logger.debug("Shows message only if debug-level is set!");
```    

## Output Example
```bash
    console.info node_modules/@mmit/logging/lib/channels/ConsoleLogger.js:23
      15:42:42.998 [INFO] Connecting to : wss://mobiad.int.mikemitterer.at:8060/message | ...st.integration.services.WebSocket
    console.info node_modules/@mmit/logging/lib/channels/ConsoleLogger.js:20
      15:42:43.148 [INFO] onOpenEvent-Payload:                               | ...st.integration.services.WebSocket
      "{\"event\":\"mm.services.websocket.onOpenEvent\"}"
    console.info node_modules/@mmit/logging/lib/channels/ConsoleLogger.js:20
      15:42:43.148 [INFO] Event:                                             | ...st.integration.services.WebSocket
      {
          "event": "showresourceevent",
          "data": {
              "resourcetype": "Job",
              "resourceid": "25ee12ff-1dc2-40dd-afc6-4a2901491e72",
              "url": "http://www.mikemitterer.at/images/mobiad.jpg"
          }
      }
    console.info node_modules/@mmit/logging/lib/channels/ConsoleLogger.js:20
      15:42:43.288 [INFO] onJsonEvent-Payload:                               | ...st.integration.services.WebSocket
```
npm package: @mmit/muni
Description: Unit-Testing-Framework (Browser only)
Author: Mike Mitterer
Latest version: 0.0.8

# MUni - Microframework for Unit-Test in your browser
> Lightweight TS library for unit-testing

## Installation

    yarn add -D @mmit/muni

## Usage

### Step I - write your Tests
```typescript
import { test} from '@mmit/muni'
import { expect } from 'chai'

export async function testMUni(): Promise<void> {

    await test('MUNI - Basics', async (): Promise<void> => {
        // tslint:disable-next-line:no-unused-expression
        expect(true, 'Value should be true').to.be.true
    })

    await test('MUNI - Expect Exception', async (): Promise<void> => {
        // tslint:disable-next-line:no-unused-expression
        expect(():void => { throw new Error("Test") }, 'Expected an Exception...').to.throw()
    })

}
```
     
### Step II - add this snippet in your HTML-Page
```html
<div id="unit-tests">
    <h1>MUnit / Browser-Tests</h1>
    <ul id="munit">
        <!-- Unit-Tests -->
    </ul>
</div>
```

### Step III - add this snippet to your main SCSS
```scss
@import "~@mmit/muni/css/muni.css";
```

### Step IV - run your Tests!
```typescript
import * as muni from '@mmit/muni'

export async function main(): Promise<void> {
    muni.resetIndicator()

    await Promise.all([
        await testMUni(),
    ])

    muni.setIndicatorTo(muni.errors === 0, { onError: (): void => {
        console.error(`Unit-Tests failed with #${muni.errors} error(s)!`)
    }})

}

```

For more examples - pls check out my [Tests](https://github.com/MikeMitterer/ts-muni/tree/master/src/browser)

## Bugs / Contribute

You reach me via [GH - Issues](https://github.com/MikeMitterer/ts-validate/issues)

Help is always welcome!

## License

    MIT License

    Copyright (c) 2021, Mike Mitterer <office@mikemitterer.at>

    Mike Mitterer: http://www.MikeMitterer.at/

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.
npm package: @mmit/tools
Description: Mix of various, unspecified, TS-tools
Author: Mike Mitterer
Latest version: 0.1.11

# Various TS-Tools
> [Live-Example]() | [GitHub-Home](https://github.com/MikeMitterer/ts-tools)

Noting spectacular here...

### range
```typescript
    test('Number of iterations', () => {
        let iterations = 0;
        range(0, 10).forEach(() => iterations++);

        expect(iterations).toBe(11);
    });
```

### loop
```typescript
    test('loop with values', () => {
        let iterations = 0;
        let sum = 0;
        loop(1, 3).through((value: number) => {
            sum += value;
            iterations++;
        });

        expect(iterations).toBe(3);
        expect(sum).toBe(6);

        iterations = 0;
        sum = 0;
        loop(3, 1).through((value: number) => {
            sum += value;
            iterations++;
        });
        expect(iterations).toBe(3);
        expect(sum).toBe(6);
    });
```
npm package: @mmit/typescript-starter
Description: This is a starter project for typescript projects
Author: Mike Mitterer
Latest version: 0.7.1

# TypeScript - Starter
> [Live-Example](http://tsstarter.example.mikemitterer.at/) | [GitHub-Home](https://github.com/MikeMitterer/typescript-starter)

## Puppeteer
> [12 examples to play with](https://www.aymen-loukil.com/en/blog-en/google-puppeteer-tutorial-with-examples/)

Read HTML: https://github.com/GoogleChrome/puppeteer/issues/2913

### Install

    yarn add @types/expect-puppeteer @types/puppeteer jest-puppeteer puppeteer -D

## QUnit
> [QUnit](http://qunitjs.com/)

Install:
    yarn add qunit @types/qunit -D
    
`tsconfig.json`:

    {
        include: [
        
            // QUnit scheint sonst nicht zu funktionieren
            "node_modules/@types/qunit/index.d.ts"
        ]
    }

`src/types/global.d.ts`:

    import 'qunit';    

## Klonen in neues Dir

    git clone git@github.com:MikeMitterer/typescript-starter.git <new project> 
    cd <new project>
    rm -rf .git
    git init

    # GH Repo anlegen e.g. ts-signer
    git remote add origin git@github.com:MikeMitterer/ts-signer.git
    
    # Repo in package.json anpassen
    "repository": {
        "type": "git",
        "url": "https://github.com/MikeMitterer/typescript-training"
    },    
    
In README.md und package.json die GH-Url anpassen
    
    # Version auf 0.1.0 ziehen
    sed -i '' -e "s/\"version\": \".*\"/\"version\": \"0.1.0\"/" package.json | cat package.json | grep '"version'
    
    # Package-Name, Description und REPO-Url anpassen
    ws package.json
    
    # Deploy evtl. auf restricted umstellen
    "deploy": "yarn version --new-version patch && yarn publish --access restricted --non-interactive",
    "deploy": "yarn version --new-version patch && yarn publish --access public --non-interactive",
    
    # README rudimentär anpassen (Title + Home) 
    Repo bei README einfügen
    
    # .rsync, .deployWebApp.conf, tools, TODO löschen
    rm -rf .rsync tools TODO     

    LICENCE anpassen
    > https://docs.npmjs.com/files/package.json#license
    
        # Evtl. (verhindert das publishen)    
        "private": true,
        
        # Wenn die Licence private ist
        "license": "UNLICENSED",
               
    build.jenkins anpassen (Builds in 'Test' können alle entfernt werden)
    
    Check ob die default-Dependencies benötigt werden
        
    # Auf GIT pushen
    git add . && git commit -am "Initial release" && git push -u origin master       
     
## Deploy-Varianten aus packages.json

   - yarn clean
   
   - yarn deploy 
   Erstellt die nötigen Files in `lib`
   
   - yarn deploy:node
   Erstellt im `bin`-Folder das File app.js dass mit `node bin app.js` aufgerufen werden kann
   
   - yarn deploy:web
   Browser-Part wird in `dist` veröffentlicht. Kann mit `simplehttpserver dist/` getestet werden
   
   - yarn test | jest
   Führt die Unit-Tests aus
   
   
## Upgrade aller packages

    yarn-upgrade-latest
    
## CI

    # Kill Browser
    ps | grep -i -C 0 "[/]webpack-dev-server" | awk '{print $1}' | while read psid; do echo "kill -HUP ${psid}"; done
npm package: @mmit/validate
Description: Object validation for/in TS
Author: Mike Mitterer
Latest version: 0.3.17

# Validate
> Lightweight TS library for validating function arguments.

## Installation

    npm i @mmit/validate
    yarn add @mmit/validate

# API changed v 0.3.0
The return value of the following functions changed from **boolean** to **string**:

      isPassword
      isAlphanumeric
      isHex
      isUuid
      isUrl
      isEmail
      isHostname
      matchesPattern

`isIndexValid` returns now the validated **array value** instead of the array index      

## Usage

```typescript
import * as validate from '@mmit/validate';

validate.isHex('1234567890abcdef');

// This throws an ArgumentError with "'1234567890abcdefg' is not a hex value"
validate.isHex('1234567890abcdefg');

// The same but with your custom error message
validate.isHex('1234567890abcdefg', () => 'My custom message');

type MyName = string | undefined;

const sayMyName = (name: MyName): MyName => name;

// This would lead to: "Type 'string | undefined' is not assignable
// to type 'string'
// const checkedName = (name: MyName): string => sayMyName(name);

// Checked version strips out "undefined"
const checkedName = (name: MyName): string => validate.notNull(sayMyName(name));

expect(checkedName("Mike")).toBe("Mike");
expect(() => checkedName(undefined)).toThrow(ArgumentError);
```

For more examples - pls check out my [Tests](https://github.com/MikeMitterer/ts-validate/tree/master/src/test/unit/validate)

## Bugs / Contribute

You reach me via [GH - Issues](https://github.com/MikeMitterer/ts-validate/issues)

Help is always welcome!

## License

    MIT License

    Copyright (c) 2019, Mike Mitterer <office@mikemitterer.at>

    Mike Mitterer: http://www.MikeMitterer.at/

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.