open-index/open-npm huggingface dataset:
npm package: @skywardapps/popcorn-api
Description: Popcorn is a communication protocol on top of a RESTful API that allows requesting clients to identify individual fields of resources to include when retrieving the resource or resource collection.
Author: Skyward App Company, LLC
Latest version: 0.9.1

# Popcorn
![numget](../media/PopcornLogo.png)
[![npm](https://img.shields.io/npm/v/@skywardapps/popcorn-api.svg?style=for-the-badge)](https://www.npmjs.com/package/@skywardapps/popcorn-api)

## Overview

Popcorn is a communication protocol on top of a RESTful API that allows requesting clients to identify individual fields of resources to include when retrieving the resource or resource collection.

It allows for a recursive selection of fields, allowing multiple calls to be condensed into one. 

See specifications for the call-response model on [GitHub](https://github.com/SkywardApps/popcorn)


## Getting Started

This presumes you have a RESTful web-api you are building, utilizing Typescript for typing and inversify-express-utils to scaffold your API endpoints on top of express.

### Requirements

* InversifyJS & inversify-express-utils
* Typescript
* Express

## Authors

![Skyward](../media/skyward.jpg)
[Skyward App Company, LLC](https://skywardapps.com)


## Technologies

![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white) ![Express.js](https://img.shields.io/badge/express.js-%23404d59.svg?style=for-the-badge&logo=express&logoColor=%2361DAFB)  ![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white) 

![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white) ![NPM](https://img.shields.io/badge/NPM-%23000000.svg?style=for-the-badge&logo=npm&logoColor=white)
npm package: @skywardapps/ts-united-types
Description: Types and classes for tracking simple units (meters, seconds, acres, etc)
Author: Skyward App Company, LLC
Latest version: 1.1.1

# ts-united-types

A library for creating, using, and tracking  `unit`-ed numbers -- that is, 'meters', 'seconds', 'volts', etc.

# Overview

![Animated code example](docs/UnitTypes.gif)

There is a _type_ level to this units, ensuring that you only assign like-units to like-units.  It also supports tracking
ratio units -- that is meters per second or pounds per square inch.  It then enables switching between units either via
elimination (eg. take meters per second and multiple it by a seconds value, you get meters ) or by direct conversion 
(eg. meters converted to feet).

```typescript
const distance1 = scalar(5, 'm');	// type: UnitedScalar<'m'>
const distance2 = scalar(10, 'm');	// type: UnitedScalar<'m'>
const time  = scalar(3, 's');		// type: UnitedScalar<'s'>

// Add two scalars together.  This uses type-safety to enforce 
// unit compatibility.
const totalDistance = distance1.add(distance2); // type: UnitedScalar<'m'>
```

```typescript
// Convert a scalar to a ratio
const rate = totalDistance.divideBy(time); // type: UnitedRatio<'m','s'>, meters/second
const metersPerSecond = rate.value;
```


Additionally, via importing the [`convert-units`](https://github.com/convert-units/convert-units) library, runtime conversion
is enabled automatically for known units within the same category (Area, Distance, Time, etc).

```typescript
const secondsToHours = converter('s', 'h');	// type: UnitConversion<'s', 'h'>
const rateInHours = rate.convertDenominator(secondsToHours); // type: UnitedRatio<'m','h'> now meters/hour and the value has changed accordingly.
const metersPerHour = rateInHours.value;
```

We can now handle values whose unit isn't know at build-time with the `dynamicToScalar` and `scalarToDynamic` methods.

```typescript
function ConvertMyAreaValueToAcres(inputValue: number, inputUnit: string): UnitedScalar<'ac'> {
    // Will throw an exception if inputUnit isn't known or is the wrong kind of unit (in this case, not area).
    return dynamicToScalar(inputValue, inputUnit, 'ac');
    // Returning a typed scalar with the value in acres. 
}
```

```typescript
function ConvertAcresToAnotherAreaUnit(inputValue: UnitedScalar<'ac'>, outputUnit: string): number {
    // Will throw an exception if outputUnit isn't known or is the wrong kind of unit (in this case, not area).
    return scalarToDynamic(inputValue, outputUnit); 
    // Returning the raw number of the value converted to the destination unit.
}
```

View the API documentation in the [docs folder.](docs/generated/modules.md)