open-index/open-npm huggingface dataset:
npm package: @0saw/foundation-media-query
Description: Lightweight addon to suit your crazy frontend needs
Author: Simusev Leonid
Latest version: 1.0.6

# Foundation Media Query

Small little nifty utility to help you work with foundation-sites media queries.

No dependencies. Except for foundation (Da-a-ah). Adds CustomEvent polyfill.

## Usage
```javascript
import mq from "@0saw/foundation-media-query";

document.addEventListener('breakpoint-change', breakpointEventListener);

function breakpointEventListener() {
    if (mq.is('large only')) {
        console.log("You've hit the right spot");
    }
}
```

You are not obligated to import `mq` to your scope. Instead you can use `event.detail` like so:
```javascript
import "@0saw/foundation-media-query";

document.addEventListener('breakpoint-change', breakpointEventListener);

function breakpointEventListener(event) {
    let mq = event.detail;

    switch (mq.current) {
        case 'medium':
            alert("You've hit the right spot");
            break;
        case 'large':
            alert("Too far");
            break;
        default:
            break;
    }
}
```


## API
mq object contains a few useful things.

### Getters
* mq.`current` - Gives you the name of current breakpoint
* mq.`currentFull` - Gives you all of the breakpoint info that we have. (I.e `mq.currentFull.matchMedia` will give you matchMedia object. In case you want to do something naughty)
* mq.`landscape` - Analog of CSS's `(orientation: landscape)`
* mq.`portrait` - Pretty straight forward
* mq.`retina` - DPI is at least 2x

### Methods
* mq.`is` - Allows you to quickly check current breakpoint
```javascript
// Either true or false
mq.is('xlarge');

// Won't return true when next breakpoint is active. ([small -> medium] -> large)
mq.is('medium only');

// portrait/ladscape/retina
mq.is('portrait');
```


## FAQ
* We obliviously need foundation to operate. But if you are using mixin version of foundation-sites - make sure to [`@include foundation-global-styles;`](https://github.com/zurb/foundation-sites/blob/92b2f187cd8f9c6b243bf06756beac960dae22df/scss/_global.scss#L136)
npm package: @0to10/aws-dynamodb
Description: Typescript library for working with DynamoDB tables
Author: 0TO10
Latest version: 1.0.0

# AWS DynamoDB library

This repository provides a library to work with DynamoDB tables.


## Getting started

Get started quickly by following the instructions below.


### Installation

Use [NPM](https://www.npmjs.com/) to install this library into your project:

```shell
npm install --save @0to10/aws-dynamodb
```


### Basic usage

Implementing a repository is easy. Create a new class and extend the abstract `Repository` class
that the library exposes.

After implementing the abstract `hydrate` method you can start using the `findBy` and `findOneBy` methods
of the repository right away. No additional configuration or methods are needed.

The `findBy` and `findOneBy` methods both accept an object of criteria, where the key is the field that
is matched and the value is the value of the field. You may use a wildcard at the end of a value to perform
a "begins_with" search on the DynamoDB table.

The `findBy` method accepts a second argument to adjust the limit of the query.

```typescript
'use strict';

import {NativeAttributeValue} from '@aws-sdk/util-dynamodb';

import {Repository} from '@0to10/aws-dynamodb';

class EntityRepository extends Repository<Entity> {

    protected hydrate(item: Record<string, NativeAttributeValue>): Entity {
        return new Entity(item);
    }

}
```


### Additional methods

Any convenience methods may be added to the repository:

In the example below, two methods have been added: `findOneByName` and `findByName`. You may choose to
run a custom query by calling the protected `query` method or call any of the public methods.

```typescript
'use strict';

import {QueryCommandInput} from '@aws-sdk/client-dynamodb';
import {NativeAttributeValue} from '@aws-sdk/util-dynamodb';

import {Repository} from '@0to10/aws-dynamodb';

class EntityRepository extends Repository<Entity> {

    public async findOneByName(name: string): Promise<Entity> {
        const params: QueryCommandInput = {
            // Define your search params
        };

        return this.query(params);
    }

    public async findByName(name: string): Promise<Entity[]> {
        return this.findBy({
            name_field: name,
        });
    }

    protected hydrate(item: Record<string, NativeAttributeValue>): Entity {
        return new Entity(item);
    }

}
```


## Return values

When using and implementing a `Repository` class, please note:

* The `hydrate` method must always return a single hydrated document
* The `findOneBy` method will always return a single entity or `undefined` if no result was found
* The `findBy` method always returns an array of entities (which may be empty)

You may typehint for an Array-like return when using the `findBy` method, but be aware that the actual
return type is a `Collection` (which extends Array). The `Collection` class exposes a `LastEvaluatedKey`
variable with which you can run consecutive queries for when you need more results than the specified
limit.
npm package: @0x-jerry/imger
Description: A command line tool that help you to generator images, support icns and ico.
Latest version: 0.4.1

# Imger

A command line tool that help you to generator images, support icns and ico.

## Install

```sh
pnpm i @0x-jerry/imger
```

Global install:

```sh
pnpm add -g @0x-jerry/imger
```

## Usage

Use [default preset](./src/presets/default.ts).

```sh
imger ./path/to/image.png ./output
```

Use json preset file.

`./preset.json`:

```json
{
  "input": "path/to/image",
  "output": "path/to/output/dir",
  "shapes": [
    "icon.ico",
    "icon.icns",
    "128x128.png",
    "128x128@2x.png",
    "512x512.png",
    {
      "name": "custom-name.png",
      "size": "25x25"
    },
    {
      "name": "custom-name@2x.png",
      "size": "25x25@2x"
    }
  ]
}
```

```sh
imger -p ./preset.json
```
npm package: @0x-jerry/load-pkg
Description: Detect the closest `package.json` recursively.
Author: 0x-jerry
Latest version: 0.1.5

# Load Pkg

Detect the closest `package.json` recursively.

## Example

```ts
const pkgFile = await loadPkg(path.join(__dirname, 'example/packages/pkg1'))
console.log(pkgFile)
```

output:

```json
{
  "path": "<root-path>/example/packages/pkg1/package.json",
  "config": {}, // content of `package.json`
  "monorepo": false,
  "parent": {
    "path": "<root-path>/example/package.json",
    "config": {}, // content of `package.json`
    "monorepo": true,
    "parent": {
      "path": "<root-path>/package.json",
      "config": {}, // content of `package.json`
      "monorepo": false
    }
  }
}
```
npm package: @0x-jerry/silver
Description: Let writing CLI like writing document.
Author: 0x-jerry
Latest version: 1.2.4

# Silver

Let writing CLI like writing a document.

## Install

```sh
pnpm i @0x-jerry/silver
```

## Usage

Example:

```ts
import { silver } from '@0x-jerry/silver'
// @autocompletion will enable `completion` subcommand to generate autocomplete script
// Autocompletion only support zsh for now, and need to install manually
// Manual install: you need to append `source <(silver completion)` to `.zshrc`
const ins = sliver`
v1.0.0 @autocompletion

Silver, let you writing CLI like writing document. ${defaultAction}

-t --test @test:defaultValue, Test autocompletion.

up/upgrade <@test:dir> [...other] #stopEarly, an sub command. ${upgradeAction}

-s --string @string:default, sub command option.
--small @bool, other option.
`

// register autocomplete
ins.type('type', () => ['t1', 't2', 't3'])

function defaultAction([type], options) {
  console.log(type, options)
}

function upgradeAction([dir], options) {
  console.log(dir, options)
}
```

## Syntax Detail

Please see [syntax.ohm](./src/grammar//syntax.ohm).

## Thanks

- [vitest](https://vitest.dev/)
- [minimist](https://github.com/minimistjs/minimist)
- [tsup](https://tsup.egoist.dev)
- [ohm-js](https://ohmjs.org/)
npm package: @0x-jerry/unocss-preset-daisyui
Description: Daisyui preset for UnoCSS
Author: 0x-jerry
Latest version: 0.2.3

# UnoCSS Preset Daisyui

A UnoCSS preset for [daisyui](https://daisyui.com/).
Due to the implementation, this is 100% compatible with daisyui with some [trade-offs](#limitations).

## Install

```sh
pnpm i @0x-jerry/unocss-preset-daisyui daisyui -D
```

## Usage

`unocss.config.ts`

```ts
import { defineConfig, presetMini, presetWind4 } from "unocss";
import { presetDaisyui } from "@0x-jerry/unocss-preset-daisyui";

export default defineConfig({
  presets: [
    presetMini(),
    // When use with wind4 preset, you need to disable reset preflight,
    // because preset daisyui already included it.
    presetWind4({
      preflights: {
        reset: false,
      },
    })
    presetDaisyui(),
  ],
});
```

`main.ts`

```ts
import "uno.css";
import "daisyui/theme/light.css";
```

## Limitations

Due to the implementation of this preset, here has some limitations:

1. All `daisyui` classes will only available in global scope.
2. `daisyui/theme/light.css` is required, or you can import any theme you want from `daisyui/theme`.
3. You can't use `@apply` with `daisyui` classes.
4. `daisyui` classes is not fully on-demand, so the bundle size may larger than expected.
npm package: @0x-jerry/x
Description: Some useful command for myself.
Author: Jerry Wang
Latest version: 2.12.9

# X

Some useful command for myself.

## Install

```sh
pnpm i -g @0x-jerry/x
```

## Run task `xr`

`xr` command can auto detect tasks in `package.json/scripts`, `deno.json/tasks`, and run it. you can also append any parameters.

Example: In a node project with `pnpm-lock.yaml`. And `package.json` has a script `"test": "vitest run"`

```sh
xr test test/*.ts
# equals
vitest run test/*.ts

# you can also execute binary file in `node_modules/.bin` folder.
xr vite --port 4004
```

Example: In a deno project with `deno.json` or `deno.jsonc`. And have a task `"dev": "deno run -A main.ts"`

```sh
xr dev
# equals
deno run -A main.ts
```

`xr` can execute js/ts file directly, also support import any `string/yaml/jsonc` file directly with import attribute.

Example:

`script.ts`

```ts
const count: number = 3;
console.log(count)

import textData from './test.txt' with { type: 'text' }
console.log(textData) // => typeof textData === 'string'

import yamlData from './test.yaml' with { type: 'yaml' }
console.log(yamlData) // => typeof yamlData === 'object'

import jsoncData from './test.jsonc' with { type: 'jsonc' }
console.log(jsoncData) // => typeof jsoncData === 'object'

import sqlStr from './files/test.sql' with { type: 'text' }
console.log(sqlStr) // => typeof sqlStr === 'string'
```

Execute it:

```sh
xr ./script.ts
```

## Dependency Manager `xn`

`xn` command can install modules by detect the correct tool automatically, it detects lockfile to decide which dependency manager tool should be used.

Example: install packages in a node project with `pnpm-lock.yaml`

```sh
xn i lodash-es
# equals
pnpm i lodash-es

xn i lodash-es -D
# equals
pnpm i lodash-es -D

# -t/--types option support install @types/xx package in one command.
xn i lodash-es --types
# equals
pnpm i lodash-es && pnpm i @types/lodash-es -D
```

Example: remove packages in a node project with `pnpm-lock.yaml`

```sh
xn rm lodash-es
# equals
pnpm uninstall lodash-es

xn rm lodash-es -D
# equals
pnpm uninstall lodash-es -D

# -t/--types option support remove @types/xx package in one command.
xn rm lodash-es --types
# equals
pnpm uninstall lodash-es @types/lodash-es
```

`xn` also support rust project.

Example: in a rust project with `Cargo.toml`

```sh
xn i log
# equals
cargo add log

xn rm log
# equals
cargo remove log
```

## Command Completions

This feature only support zsh.

Add those code to `~/.zshrc`

```zsh
source <(x completion)
source <(xr completion)
source <(xn completion)
```
npm package: @0x-jerry/x-release
Description: A convenient tool that helps you to create a new release.
Latest version: 3.0.1

# X-Release

A tool that helps you to create a new release quickly.

## Install

```sh
pnpm i @0x-jerry/x-release -D
# or
pnpm i @0x-jerry/x-release -g
```

## Usage

```
Usage:
  $ x-release [new-version]

Commands:
  [new-version]  the tasks to run.

Example:

- x-release --patch
- x-release 0.0.1
- x-release 0.1.1 --publish false


For more info, run any command with the `--help` flag:
  $ x-release --help

Options:
  --patch                auto-increment patch version number
  --minor                auto-increment minor version number
  --major                auto-increment major version number
  --prepatch             auto-increment prepatch version number
  --preminor             auto-increment preminor version number
  --premajor             auto-increment premajor version number
  --prerelease           auto-increment prerelease version number
  --publish              run npm publish, default is true
  --tag <tag-tpl>        new tag format, default is: "v${version}"
  --commit <commit-tpl>  the commit message template, default is: "chore: release v${version}"
  -h, --help             Display this message
  -v, --version          Display version number
```

## Configuration

Config file: `release.conf.ts`

Example config file:

```ts
import { defineConfig } from '@0x-jerry/x-release'

export default defineConfig({
  /**
   * run npm publish, default true
   */
  publish: true,
  /**
   * tag template
   */
  tag: '${prefix}v${version}',
  /**
   * commit template
   */
  commit: 'chore: release ${prefix}v${version}',
  /**
   * run tasks after bump version
   */
  tasks: [
    'npm test', // run npm test
    async (ctx) => {
      console.log('new version is:', ctx.nextVersion)

      await ctx.run(`echo "custom script, all tasks are finished!"`)
    },
  ],
})
```

Package.json `release`

```json
{
  "release": {
    "publish": true,
    "tag": "${prefix}v${version}",
    "commit": "chore: release ${prefix}v${version}",
    "tasks": [
      "npm run test",
      "echo 'run custom script after bump version'",
      "echo 'this should be the last script'"
    ]
  }
}
```