open-index/open-npm huggingface dataset:
npm package: @smolswap/sdk
Description: 🛠 An SDK for building applications on top of Sushiswap.
Latest version: 5.0.13

# Sushiswap SDK

In-depth documentation on this SDK is available at [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/).

This modifies uniswap-sdk's UniswapV2Factory address. The new address for sushiswap is  `0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac`.

## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.

First clone the repository:

```sh
git clone https://github.com/sushiswap/sushiswap-sdk.git
```

Move into the sushiswap-sdk working directory

```sh
cd sushiswap-sdk/
```

Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```
npm package: @smonn/builder
Description: Build objects from schemas
Author: Simon Ingeson
Latest version: 0.0.3

# @smonn/builder

Build objects from schemas.

```sh
npm install @smonn/builder
```

```ts
import { Builder, type InferOptions, type InferResult, sequence } from "@smonn/builder";

const nested = Builder.from({
  // use functions for dynamic values
  shout: ({ message }: { message: string }) => message.toUpperCase(),
});

const builder = Builder.from({
  // automatically increment the id using the sequence helper
  id: sequence(),

  // non-function values are used as-is
  literal: 42,

  // nest builders to make more complex objects
  nested: (options: InferOptions<typeof nested> & { count: number }) =>
    nested.buildList(options.count, options),
});

// obj type === InferResult<typeof builder>
const obj = builder.build({
  // options will be an intersection of the first parameter to each function in the schema
  // note: take care to not mismatch the option types when reusing the same keys
  message: "Hello World",
  count: 2,
});
// => { id: 1, literal: 42, nested: [{ shout: "HELLO WORLD" }, { shout: "HELLO WORLD" }] }
```
npm package: @smonn/container
Description: TypeScript-based dependency injection container
Author: Simon Ingeson
Latest version: 2.0.0

# @smonn/container

Dependency injection container. Attempts to avoid fixed dependencies via decorators. It also always returns the same instance unless you explicitly ask for a new instance. Instances are lazily created, meaning nothing is created until you request an instance. TypeScript optional, but attempts to infer types as much as possible.

## Install

```sh
npm install @smonn/container
```

```sh
yarn add @smonn/container
```

## Usage

Example usage. See more examples in the test files.

```ts
import { expect, test } from "vitest";
import { createContainer, createToken, IContainer } from "../src/index";

// Interfaces are optional, but can help to ensure you depend on abstractions only.
interface IGreeter {
  sayHello(): string;
}
interface IShouter {
  shoutHello(): string;
}

class Greeter implements IGreeter {
  // Can either define tokens along with the class implementation...
  static token = createToken<IGreeter>("greeter");

  constructor(private readonly name: string) {}

  sayHello(): string {
    return `Hello, ${this.name}!`;
  }
}

class Shouter implements IShouter {
  static token = createToken<IShouter>("shouter");

  constructor(private readonly greeter: IGreeter) {}

  shoutHello(): string {
    return this.greeter.sayHello().toUpperCase();
  }
}

class Other {
  ping() {
    return "pong";
  }
}

// Or define token types in a central location to help avoid circular imports.
const Tokens = {
  // Token type can also be inferred from the function signature
  name: createToken("name", String),

  // Or use explicit type and infer name from class
  other: createToken("other", Other),
} as const;

// Group together related classes in a single function to avoid a single
// massive function defining hundreds of dependencies. Also note that thanks to
// the token spec, explicitly declaring the generic type is not required.
function provideModule(container: IContainer) {
  // Literal/basic values are allowed
  container.set(Tokens.name, "Joy");
  container.set(Tokens.other, new Other());

  // Use factory functions to help resolve dependencies
  container.set(Greeter.token, (c) => new Greeter(c.get(Tokens.name)));
  container.set(Shouter.token, (c) => new Shouter(c.get(Greeter.token)));
}

const container = createContainer();
container.register(provideModule);

// Here shouter will have the correct type (the IShouter interface)
const shouter = container.get(Shouter.token);

test('returns "HELLO, JOY!"', () => {
  expect(shouter.shoutHello()).toBe("HELLO, JOY!");
});

test("always get the same instance", () => {
  expect(container.get(Shouter.token)).toBe(container.get(Shouter.token));
});

test("always get a new instance", () => {
  expect(container.create(Shouter.token)).not.toBe(
    container.create(Shouter.token)
  );
});

test("other will never create a new instance", () => {
  expect(container.create(Tokens.other)).toBe(container.create(Tokens.other));
});
```
npm package: @smonn/postgres-migrate
Description: PostgreSQL forward-only migration CLI tool using Postgres.js
Author: Simon Ingeson
Latest version: 0.0.0

# @smonn/postgres-migrate

PostgreSQL forward-only migration tool using [Postgres.js](https://www.npmjs.com/package/postgres).

```sh
# 1. install
pnpm install @smonn/postgres-migrate

# 2. generate migration file
spm generate 'my migration'

# 3. edit the migration file as needed

# 4. apply pending migrations
spm apply

# 5. reset the database
spm reset
```

## Configuration

Assumes the environment variable `DATABASE_URL` is set, either in the current shell or in a `.env` file (relies on [`dotenv`](https://www.npmjs.com/package/dotenv)).

You can also customize the migrations directory using the `--dir` / `-d` flag with any of the commands. It defaults to the current working directory + `migrations`.

## Commands

### `spm generate [--dir=./migrations] [name]`

Generates a new migration file. If name is not provided, you will be prompted for one. The name will be transformed into snake_case and made lowercase. All non-alphanumeric characters will be stripped.

### `spm apply [--dir=./migrations]`

Applies all pending migrations in a single transaction. Will fail if a previously applied migration was changed, causing the checksum to mismatch.

### `spm reset [--dir=./migrations] [--force]`

Drops all tables and re-applies all migrations. Use `--force` / `-f` to skip the confirmation prompt.