open-index/open-npm huggingface dataset:
npm package: @leavo/book-story
Description: A Progressive Web App, created by react and vite@2, based on Functional Component
Author: flasco
Latest version: 0.0.30

# book-story

A Progressive Web App, created by react and vite@2, based on Functional Component

it use:

- typescript
- axios (http request framework)
- antd-mobile@5 (UI framework)
- react-router-cache-route (simulate native app page navigation)
npm package: @leawind/rop
Description: Evaluate expression with operator overloading and Python-style array slicing using tagged template literal.
Latest version: 0.0.2

[中文](./README.zh.md) | **English**

[![GitHub License](https://img.shields.io/github/license/Leawind/rop?color=%2377f)](https://github.com/Leawind/rop)
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/Leawind/rop/ci.yml?branch=main&logo=github-actions&label=test)](https://github.com/Leawind/rop/actions/workflows/ci.yml)
[![NPM Version](https://img.shields.io/npm/v/@leawind/rop?color=bc3433)](https://www.npmjs.com/package/@leawind/rop)

# rop (Runtime Operator Parser)

`rop` is a TypeScript/JavaScript library that parses and evaluates expressions via [tagged template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates). It supports **operator overloading** for custom and built-in types, enabling custom behaviors for JS operators and **Python-style array slicing**.

## Usage examples

Before reading the [Quick Tutorial](./test/quick-tutorial.test.ts), these examples below show what `rop` can do:

### Evaluate a simple expression

```ts
o`2 + 3` // 5

// Value embedding
o`${2} + 3` // 5
```

### Array Slicing

Python-style array slicing syntax:

```ts
Rop.INST.bind({ arr: [1, 2, 3, 4, 5] })

// Basic slicing
o`arr[1:3]` // [2, 3]

// Negative indices
o`arr[:-2]` // [1, 2, 3]

// With step
o`arr[::2]` // [1, 3, 5]

// Reverse
o`arr[::-1]` // [5, 4, 3, 2, 1]

// Multi-dimensional slicing (for custom types)
o`${tensor}[2:5, 1:5, 4:7]`
```

### Operator overload for Array

```ts
o`${[2, 3]} + ${[4, 5]}` // [2, 3, 4, 5]
```

### Operator overloading for `Set`

```ts
Rop.INST.bind({
  a: new Set([1, 2, 3]),
  b: new Set([3, 4, 5]),
})
o`a + b` // Set { 1, 2, 3, 4, 5 }
```

### Property access and indexing

```ts
Rop.INST.bind({
  obj: { name: 'Alice' },
  arr: [1, 2, 3],
})

// access property `name` on `obj`
o`obj.name` // Alice

// index `obj` with `name`
o`obj['name']` // Alice
o`arr[1]` // 2
```

### Operator overloading for custom type `Vec2` (assume you have it implemented)

```ts
// bind identifiers `a` and `b`, so you can use them in the expression.
rop.bind({
  a: new Vec2(2, 3),
  b: new Vec2(3, 4),
})
rop.o<Vec2>`a + b` // Vec2 { x: 5, y: 7 }
```
npm package: @leax/cli
Description: cli of leax
Author: ruichao
Latest version: 2.2.0

### Used

```
  npm i -g @leax/cli

  leax create my-project

```
#### OPTIONS

- -f、--force
  + 强制删除本地文件
- --merge
  + 强制合并本地文件
- -m、--packageManager <command>
  + 使用输入的包管理器

> 当前版本 v2.2.0，后续持续更新
npm package: @leax/cli-server
Description: cli-server for @leax/cli
Author: ruichao
Latest version: 2.2.0

### Used
```
  npm install @leax/cli-server -D
  
  // package.json
  "scripts": {
    "dev": "leax-server dev",
  }

  // leax.config.js
  module.exports = {
    entry: 'xxx',
    output: {
      path: './dist',
      publicPath: '/',
      filename: 'js/[name].[contenthash:6].js',
      clean: true,
    },
    mode: process.env.NODE_ENV || 'development',
    devServer: {
      host: 'localhost',
      static: 'dist',
      port: 8000,
      open: true,
      hot: true,
    },
    extensions: ['.js', '.jsx', '.ts', '.tsx', '.scss', '.css'],
    alias: {
      '@': './src',
    },
  }
  ...
```
npm package: @leax/cli-shared-utils
Description: cli-shared-utils of leax
Author: ruichao
Latest version: 2.2.0

## Used

```html
  npm install @leax/cli-shared-cli
  // or
  yarn add @leax/cli-shared-cli
  // or
  pnpm install @leax/cli-shared-cli

  export declare const hasGit: () => boolean
  export declare const hasProjectGit: (cwd: string) => any
  export declare const hasYarn: () => boolean
  export declare const hasProjectYarn: (cwd: string) => boolean
  export declare const hasProjectNpm: (cwd: string) => any

  export declare const resolveModule: (request: string, context: string) => any
  export declare const loadModule: (request: string, context: string, force?: boolean) => any
  export declare const clearModule: (request: string, context: string) => void
  export declare const clearRequireCache: (id: string, map?: Map<any, any>) => void

  export declare const log: (text: string) => void
  export declare const done: (text: string) => void
  export declare const warn: (text: string) => void
  export declare const error: (text: string) => void
  export declare const clearConsole: (title?: string) => void

  export declare const logWithSpinner: (symbol: string, msg?: string) => void
  export declare const stopSpinner: (persist?: boolean) => void

  export declare const isPlugin: (id: string) => boolean
  export declare const matchPluginId: (id: string, pid: string) => boolean

  export declare const resolvePkg: (context: string) => any

  export declare const request: {
    get(url: string, opts: any): any
  }

  export { default as chalk } from 'chalk'
  export { default as ora } from 'ora'
  export { default as LRU } from 'lru-cache'
```