open-index/open-npm huggingface dataset:
npm package: @swimscribe/design-system
Author: SwimScribe
Latest version: 0.0.8

This is the design system for [SwimScribe](https://www.swimscribe.com).

Built with [Stitches](https://github.com/modulz/stitches) and [Radix UI Primitives](https://radix-ui.com/primitives/docs/overview/introduction).
npm package: @swimshahriar/re-modal
Description: A simple react modal, dropdown component
Author: S. M. Shahriar
Latest version: 1.2.1

### Features

- Supports Nested modal ✅
- Supports draggable dropdown menu ✅
- Style object for styling 🖌

### Installation

```zsh
npm i @swimshahriar/re-modal
# or
yarn add @swimshahriar/re-modal
```

### Examples

Link: [sandbox](https://codesandbox.io/s/swimshahriar-re-modal-cjbfd?file=/src/App.js)
<br/>

### Props

| Prop          | Type                        | isRequired                     |
| ------------- | --------------------------- | ------------------------------ |
| open          | boolean                     | required                       |
| onClose       | function                    | required                       |
| type          | string ('modal','dropdown') | optional                       |
| isOverlay     | boolean                     | optional                       |
| draggable     | boolean                     | optional                       |
| targetRef     | useRef Element              | required if type is 'dropdown' |
| style         | style object                | optional                       |
| dragAreaStyle | style object                | optional                       |
npm package: @swinc/fetch-ppubs-patents
Description: A Nodejs TypeScript/JavaScript library for pulling patents from the USPTO Patent Public Search API
Author: Iain R. Cunningham
Latest version: 6.0.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# fetch-ppubs-patents

`fetch-ppubs-patents` is a TypeScript/JavaScript library for pulling patents from the USPTO [Patent Public Search](https://ppubs.uspto.gov/pubwebapp/) API.

It has only one dependency: [axios](https://axios-http.com/).

## Usage

Consistent with the Patent Public Search API, there are only three top-level methods:

* `fp.searchPatents(query)`
    * returns an object with search details, including an array with basic patent details (guid, title, classifications, etc. but no main text)
    * see type for fields on returned object
* `fp.getPatentByGuid(guid)`
    * returns an object with full patent details
* `fp.getPatent(patentNumber)`
    * a convienence function that returns an object with full patent details for the first search hit on the passed `patentNumber` parameter

For example:

```
import * as fp from 'fetch-ppubs-patents'

const results = fp.searchPatents("nvidia.as.")

const firstResult = results.patents[0].publicationReferenceDocumentNumber // "11508113"

const patent = fp.getPatent(firstResult)

console.log(patent)

{
  guid: 'US-11508113-B2',
  publicationReferenceDocumentNumber: '11508113',
  compositeId: '1000006700342!US-US-11508113',
  publicationReferenceDocumentNumber1: '11508113',
  datePublishedKwicHits: null,
  datePublished: '2022-11-22T00:00:00Z',
  inventionTitle: 'Denoising techniques suitable for recurrent blurs',
  type: 'USPAT',
  mainClassificationCode: '1/1',
  applicantName: [ 'NVIDIA Corporation' ],
  assigneeName: [ 'NVIDIA Corporation' ],
  /* LOTS OF OTHER STUFF */
}
```
### Properties of API Responses

Properties of the API responses are defined in the `src/types` directory.

The search API response is defined in [PPubsSearchAPIResponse.ts](./src/types/PPubsSearchAPIResponse.ts).

The patent API response is defined in [PPubsHighlightAPIResponse.ts](./src/types/PPubsHighlightAPIResponse.ts).

## USPTO Terms of Use

This library uses an undocumented API present in the USPTO Public Patent Search system.

Per the [USPTO Terms of Use](https://www.uspto.gov/terms-use-uspto-websites), this API is "not designed or intended to be a source for bulk downloads of USPTO data when accessed through the website’s interfaces."

Please respect USPTO systems and do not use this API for bulk downloads. Alternative [Electronic Bulk Data Products](https://www.uspto.gov/learning-and-resources/electronic-bulk-data-products) are available.

## Development

### Building from TypeScript

`npm run build` will build the TypeScript files in `src` and `tests` directories to the `dist` directory.

### Testing

`npm test` will run the *TypeScript* tests in the `tests` directory. Use during development.

`npm run test:js` will run the *JavaScript* tests in the `dist/tests` directory. Use to verify correct build for deployment.
npm package: @swindle/color
Description: Represent and manipulate color codes in different formats.
Author: Patrick Luy
Latest version: 1.0.0

# Swindle Color
Manipulate and represent colors in different formats.

Currently, Color only suppoerts Hex and RGBA color codes.

# installation
To install Swindle, just use the following command with NPM
```
npm i @swindle/color
```
Similarly, run the following command with Yarn
```
yarn add @swindle/color
```

# Usage
```ts
import { Color, Hex, RGBA } from '@swindle/color';

// instantiating colors.
const red = Color.Red();
const blue = Color.FromRGBA(0,0,255);
const white = Color.FromHex('#FFFFFF');
const black = new Color(new RGBA(0,0,0));
const green = new Color(new Hex('#00FF00'));

// getting RGBA and Hex code from color.
const hexBlue = blue.hex();
const rgbaRed = red.rgba();

// equality.
const myColor = Color.FromRGBA(255,0,0);
if (myColor.equals(red)) {...} // => true
if (myColor.equals(green)) {...} // => false
if (myColor.equals(undefined)) {...} // => false

// getting the plain value from a Hex instance.
const codeValue = hexBlue.value(); // #0000FF
const codeStr = hexBlue.toString(); // // #0000FF

// getting the rgba value from an RGBA instance.
const r = rgbaRed.r(); // 255
const g = rgbRed.g(); // 0
const b = rgbaRed.b(); // 0
const alpha = rgbaRed.a(); // 1.0
```

# Tests
To run the tests, use the following command with NPM
```
npm run test
```
Or, with Yarn
```
yarn test
```
# Issues and Bug Reporting
If you are facing any problems while using Swindle, feel free to open an issue, where we'd be happy to help you out.

# License
Swindle is available under the MIT license.
npm package: @swindle/core
Description: Utilitiy classes for data manipulation.
Author: Patrick Luy
Latest version: 2.2.1

# Swindle Core
Utilitiy classes for data manipulation.

# Installation
To install Swindle/Core with NPM,
```
npm install @swindle/core
```
With yarn,
```
yarn add @swindle/core
```
# Usage
Swindle provides a variety of Utility classes
- [Common Interfaces and Types](src/common/README.md)
- [Dates and Durations](src/dates/README.md)
- [Email Address](src/email/README.md)
- [Geography](src/geography/README.md)
- [Hashing](src/crypto/README.md)
- [Phone Number](src/phone-number/phone-number/README.md)
- [UUID](src/id/uuid/README.md)
- [Formatters](src/formatters/README.md): Utilities to help format data.

# Tests
To run the tests, use the following command with NPM
```
npm run test
```
with Yarn
```
yarn test
```
npm package: @swindle/cqrs
Description: An implementation of the CQRS pattern.
Author: PatrickLumenus
Latest version: 2.2.3

# @swindle/cqrs
A Command Query Responsibility Segregation (CQRS) module for NodeJS

# Installation
To install @Swindle/CQRS, use the following command with npm
```
npm install @swindle/cqrs
```
With Yarn,
```
yarn add @swindle/cqrs
```

# Usage
## Defining a Command
To define a Command, we extend the `Command` class.
```ts
import { Command } from '@swindle/cqrs`;

export class CreateUserCommand extends Command {

    constructor() {
        super();
    }

    public async execute(data: UserData): Promise<void> {
        // definition here.
    }
}
```
All commands extends the `Command` class. Every `Command` class defines an `execute()` method, wheich defines the body of the command. The `execute()` method is very flexible and 
allows you to pass in however many parameters you need.

We can use our command as follows.
```ts
import { CreateUserCommand } from './command.class';
import { UserData } from 'path/to/user/data';

const data: UserData = {
    id: 'some-id',
    name: 'John'
}

const createUser = new CreateUserCommand();
await createUser.execute(data);
```

## Defining a Query
To define a query, we extend the `Query` class.
```ts
import { Query } from '@swindle/cqrs`;

export class GetUserByIdQuery extends Query {

    constructor() {
        super();
    }

    public async execute(id: string): Promise<UserData> {
        // definition here...
        return data;
    }
}
```
All queries extend the `Query` class. Every `Query` class defines an `execute()` method, wheich defines the body of the command. The `execute()` method is very flexible and 
allows you to pass in however many parameters you need.

We can use our query as follows.
```ts
import { GetUserByIdQuery } from './query.class';

const getUserById = new GetUserByIdQuery();
const user = await getUserById.execute('foo');
console.log(user);
```
npm package: @swindle/filesystem
Description: Filesystem utilities.
Author: Patrick Luy
Latest version: 1.0.8

# Swindle FileSystem
Swindle FileSystem provides filesystem access utilities. 

# Installation
To install Swindle FileSystem with NPM,
```
npm install @swindle/filesystem
```
With yarn,
```
yarn add @swindle/filesystem
```
# Usage
Swindle FileSystem provides a variety of Utility classes
- [FileSystem](src/filesystem/README.md): A utility to interact with the Filesystem.
- [File](src/file/README.md): A utility to work with files.
- [Path](src/path/README.md): A utility for working with paths.

# Tests
To run the tests, use the following command with NPM
```
npm run test
```
with Yarn
```
yarn test
```
npm package: @swindle/os
Description: Utilities for working with the operating system.
Author: Patrick Luy
Latest version: 1.0.11

# Swindle OS
Utilities for working with the operating system and runtime.

Note: This package is still experimental and still subject to breaking changes.

# Installation
To install Swindle OS with NPM,
```
npm install @swindle/os
```
With yarn,
```
yarn add @swindle/os
```
# Usage
Swindle OS provides a variety of Utility classes
- [Process](src/process/README.md): A utility class to work with the current process.

# Tests
To run the tests, use the following command with NPM
```
npm run test
```
with Yarn
```
yarn test
```
npm package: @swindle/specification
Description: An implementation of the specification pattern.
Author: Patrick Luy
Latest version: 1.0.1

# Swindle Specification
Swindle Specification provides an implementation of the [Specification](https://en.wikipedia.org/wiki/Specification_pattern)_ Design Pattern. 

# Installation
To install Swindle FileSystem with NPM,
```
npm install @swindle/specification
```
With yarn,
```
yarn add @swindle/specification
```
# Usage
Swindle Specification exposes a single `CompositeSpecification` class for you to extend to define your specifications.

```ts
import { CompositeSpecification } from "@swindle/specification";

export class UnitedStatesLegalAgeSpeciication extends CompositteSpecification {

    constructor() {
        //
    }
}
```

To define your specification, we implements the `isSatisfiedBy(suspect)` method. The `isSatisfiedBy()` method takes a single argument and returns a boolean value indicating if that argument has met the requirements specified by the specification.

```ts
import { CompositeSpecification } from "@swindle/specification";

export class UserLegalAgeSpeciication extends CompositteSpecification {

    constructor() {
        //
    }

    public isSatisfiedBy(user: User): boolean {
        return user.age() >= 18;
    }
}
```
Here, we specify that our specification determines if the user is of legal age. In our case we determine if the user is at least 18 years of age, the legal age in the US. The data type of the suspect argument can be anything that meets your needs. In most cases, it will be some model class representing some idea in your domain (a user, a post, etc...).

To use our specification, we can just do the following.

```ts
// in some part of your application.
import { User } from "...";
import { UserLegalAgeSpecification } from "...";

const bob = new User("Bob", 15);
const sally = new User("Sally", 21);
const legalAgeSpec = new UserLegalAgeSpecification();

if (legalAgeSpec.isSatisfiedBy(bob)) {
    console.log("Bob can serve in the military");
}
else {
    console.log("Bob cannot serve in the military");
}

if (legalAgeSpec.isSatisfiedBy(sally)) {
    console.log("Sally can serve in the military");
}
else {
    console.log("Sally cannot serve in the military");
}
```

You can even chain specifications to run multiple tests on a suspect.

```ts
const userRegistration = new UserRegistration(...);
const userAgeSpec = new UserAgeSpecification();
const userSpecialPermissionsSpec = new UserSpecialPermissionsSpecification();

canRegister = userAgeSpec.or(userSpecialPermissionsSpec).isSatisfiedBy(userRegistration);
```

# Tests
To run the tests, use the following command with NPM
```
npm run test
```
with Yarn
```
yarn test
```
npm package: @swindle/structs
Description: Implementations of common data structures.
Author: Patrick Luy
Latest version: 1.0.5

# Swindle/Structs
Swindle/Structs provides implementations for basic data structures.

# Installation
To install Swindle/Structs with NPM,
```
npm install @swindle/structs
```
With yarn
```
yarn add @swindle/structs
```

# Usage
Swindle/Structs provide the following data structures.
- [LinkList](src/linked-list/README.md) provides an implementation of a LinkList.
- [PriorityQueue](src/priority-queue/README.md) provides an implementation of a priority queue.
- [Queue](src/queue/README.md) provides an implementation of a queue.
- [Stack](src/stack/README.md) provides an implementation of a stack.

# Tests
To run the tests, use the following command with NPM
```
npm run test
```
with Yarn
```
yarn test
```