open-index/open-npm huggingface dataset:
npm package: @staven/wx-cli
Description: > npm i -g @staven/wx-cli
Author: staven
Latest version: 0.0.4

# 微信小程序 @staven/wx-cli

> npm i -g @staven/wx-cli

# 开发流程

### 创建

&nbsp;&nbsp;有两种创建方式。appid 可选参数，为小程序 appId。

- 在目录下创建项目

  > wx create 项目名 appid

- 在项目目录里初始化项目
  > wx init appid

### 新建 page

&nbsp;&nbsp;自动在 app.json 中添加 pages 或分包路径。
&nbsp;&nbsp;第三个参数以非 pages/开头将视为分包创建

> wx new pages/demo

&nbsp;&nbsp;生成 pages/demo/index.js(scss/json/wxml)

> wx new pages/demo demo

&nbsp;&nbsp;生成 pages/demo/demo.js(scss/json/wxml)

> wx new subs/demo

&nbsp;&nbsp;生成 subs/demo/index.js(scss/json/wxml)

> wx new subs/demo demo

&nbsp;&nbsp;生成 subs/demo/demo.js(scss/json/wxml)

### 新建 component

> wx comp demo

### 更新配置

&nbsp;&nbsp;主要更新 gulp 配置，以及依赖

> wx update

### 开发

> wx serve

### 上线

> wx build

# 环境变量配置

&emsp;&emsp;在项目根目录下 config.js 配置 serve(开发),build(正式)环境的变量

```
module.exports = {
  serve: {
    baseApi: 'https://test.com/api',
    source: 'https://test.com/images'
  },
  build: {
    baseApi: 'https://prod.com/api',
    source: 'https://prod.com/images'
  },
}

```

### js 文件中使用环境变量

```
onLoad() {
  const api = `/* @echo baseApi */getCityList`;
}
```

wx build 编译后

```
onLoad: function onLoad() {
  var api = "https://prod.com/api/getCityList";
}
```

### wxml 文件中使用环境变量

```
<image mode="widthFix" src="<!-- @echo source -->/banner.png"></image>
```

wx build 编译后

```
onLoad: function onLoad() {
  var image = "https://prod.com/images/banner.png";
}
```
npm package: @stavros-tsioulis/typed-events
Description: A fully typed EventEmitter implementation compatible with Node.js EventEmitter API
Author: Stavros Tsioulis
Latest version: 1.0.0

# typed-events

A type-safe EventEmitter implementation compatible with Node.js EventEmitter API.

## Installation

```bash
npm install @stavros-tsioulis/typed-events
# or
pnpm add @stavros-tsioulis/typed-events
# or
yarn add @stavros-tsioulis/typed-events
```

## Usage

```typescript
import { EventEmitter } from 'typed-events';

// Define your event types
type MyEvents = {
  userLogin: [userId: string, timestamp: number];
  userLogout: [userId: string];
  message: [from: string, to: string, content: string];
};

// Create an event emitter with typed events
const emitter = new EventEmitter<MyEvents>();

// Add listeners with full type safety
emitter.on('userLogin', (userId, timestamp) => {
  console.log(`User ${userId} logged in at ${timestamp}`);
});

emitter.on('message', (from, to, content) => {
  console.log(`${from} → ${to}: ${content}`);
});

// Emit events with type checking
emitter.emit('userLogin', 'user123', Date.now());
emitter.emit('message', 'alice', 'bob', 'Hello!');

// TypeScript will catch errors:
// emitter.emit('userLogin', 'user123'); // Error: missing timestamp argument
// emitter.emit('invalidEvent', 'data'); // Error: event doesn't exist
```

## License

MIT
npm package: @stavtar/design-system-lib
Description: StavPay Design System Library
Author: Your Name
Latest version: 1.0.0

# StavpayDesignSystemLib

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.3.0.

## Code scaffolding

Run `ng generate component component-name --project stavpay-design-system-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project stavpay-design-system-lib`.
> Note: Don't forget to add `--project stavpay-design-system-lib` or else it will be added to the default project in your `angular.json` file. 

## Build

Run `ng build stavpay-design-system-lib` to build the project. The build artifacts will be stored in the `dist/` directory.

## Publishing

After building your library with `ng build stavpay-design-system-lib`, go to the dist folder `cd dist/stavpay-design-system-lib` and run `npm publish`.

## Running unit tests

Run `ng test stavpay-design-system-lib` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
npm package: @staxjs/codemod
Description: Migration helpers for stax
Author: Philip Johnston
Latest version: 0.1.4

# @reflexjs/codemod

Provides Codemod transformations to help with code upgrade and migration.

## Usage

```sh
npx @reflexjs/codemod <transform> <path
```

- `transform` - name of the transform
- `path` - files or directory to transform
- `--dry` - Performs a dry-run, no code changes
- `--print` - Prints the changes for comparison

## Codemods

### `to-reflexjs`

This Codemod migrates your `@reflexjs/componens` code to `reflexjs` code.

```js
npx @reflexjs/codemod to-reflexjs
```

Example:

```jsx
import { Div, H1, Button } from "@reflexjs/components"

export default function () {
  return (
    <Div d="flex">
      <H1>This is a heading</H1>
      <Button variant="primary lg">Button</Button>
    </Div>
  )
}
```

Will be transformed to:

```jsx
export default function () {
  return (
    <div display="flex">
      <h1 variant="heading.h1">This is a heading</h1>
      <button variant="button.primary.lg">Button</button>
    </div>
  )
}
```
npm package: @staxjs/generator
Description: File generation for the Stax CLI
Author: Philip Johnston
Latest version: 0.2.0

# `generator`

This package houses all files related to Blitz codegen. In the main `src` directory you'll find the base `generator` class and a directory of `generators` that extend it. The subclasses aren't terribly interesting, most of the fun happens in the abstract parent class. Each generator may (depending on whether it's a net new addition or modifying existing files) have a corresponding template defined in the `templates` directory.

Creating a new generator requires a new `Generator` subclass inside of `src/generators`, and potentially a new template in `templates` if the generator generates net-new files. For templates, we use our own templating language. Each variable in a template surrounded by `__` (e.g. `__modelName__`) will be replaced with the corresponding value in the object returned from `Generator::getTemplateValues`. This type of replacement works in filenames as well.

The generator framework also supports conditional code generation, similar to other common templating languages like handlebars. All model variables are exposed via `process.env` and can be used in conditional statements. The generator will not evaluate any expressions in the conditional, so the condition must be evaluated in the generator class and passed as a variable to the template. Both `if else` and ternary statements are supported, and for `if` statements no `else` is required:

```js
// VALID
if (process.env.someCondition) {
  console.log("condition was true")
}

// VALID
if (process.env.someCondition) {
  console.log("condition was true")
} else {
  console.log("condition was false")
}

// VALID
const action = process.env.someCondition
  ? () => console.log("condition was true")
  : () => console.log("condition was false")

// **NOT** VALID
// This will compile fine, but will not product the expected results.
// The template argument `someValue` will be evaluated for truthiness
// and the conditional will be evaluated based on that, regardless of
// the rest of the expression
if (process.env.someValue === "some test") {
  console.log("dynamic condition")
}
```
npm package: @staxjs/installer
Description: Package installation for the Stax CLI
Author: Philip Johnston
Latest version: 0.2.0

# `installer`

The installer package houses all of the types, classes, and utilities for building a Blitz Recipe. A Blitz recipe is effectively just a list of steps, represented as an array of objects that conform to one of the types in the `Executor` union type (`NewFileExecutor | AddDependencyExecutor | FileTransformExecutor`). These executors are processed by the framework, executed interactively by the user, and ultimately run to install new packages to an existing Blitz app.

You can find the implementation of all Executors in the `executors/` directory, stock transforms that we'll be supplying to authors in `transforms/`, and various utilities in `utils/`, including a `paths` utility that the user can access for common paths to modify such as `_document.tsx`.
npm package: @staxjs/transforms
Description: Codeshift transforms for Jamstack projects
Author: Philip Johnston
Latest version: 0.1.4

# `config`

> A centralized source for reading project configurations from `stax.config.js`.

## Usage

```js
import { getConfig } from '@staxjs/config'

const config = getConfig()

console.log(config._meta.packageName)
```
npm package: @stay.hungry07212/umi-eddsa-web3js
Description: An Eddsa implementation relying on Solana's web3.js
Author: Metaplex Maintainers
Latest version: 0.9.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# umi-eddsa-web3js

An Eddsa implementation relying on Solana's web3.js.

## Installation

```sh
npm install @metaplex-foundation/umi-eddsa-web3js
```
npm package: @stay.hungry07212/umi-rpc-chunk-get-accounts
Description: RPC decorator that chunks getAccounts requests into batches
Author: Metaplex Maintainers
Latest version: 0.9.1

# umi-rpc-chunk-get-accounts

An RPC decorator that chunks getAccounts requests into batches of a given size, and run them in parallel.

## Installation

```sh
npm install @metaplex-foundation/umi-rpc-chunk-get-accounts
```
npm package: @stay.hungry07212/umi-rpc-web3js
Description: An RPC implementation relying on Solana's web3.js
Author: Metaplex Maintainers
Latest version: 0.9.1

# umi-rpc-web3js

An RPC implementation relying on Solana's web3.js.

## Installation

```sh
npm install @metaplex-foundation/umi-rpc-web3js
```
npm package: @stay.hungry07212/umi-serializer-data-view
Description: A serializer implementation relying on the native DataView API
Author: Metaplex Maintainers
Latest version: 0.9.1

# umi-serializer-data-view

⚠️ **This plugin is deprecated. You can now directly use `@metaplex-foundation/umi/serializers` instead.** ⚠️

A serializer implementation relying on the native DataView API.

## Installation

```sh
npm install @metaplex-foundation/umi-serializer-data-view
```
npm package: @stay.hungry07212/umi-signer-wallet-adapters
Description: A Signer implementation relying on Solana's wallet adapters
Author: Metaplex Maintainers
Latest version: 0.9.1

# umi-signer-wallet-adapters

A Signer implementation relying on Solana's wallet adapters.

## Installation

```sh
npm install @metaplex-foundation/umi-signer-wallet-adapters
```
npm package: @stay.hungry07212/umi-storage-mock
Description: A mock implementation of the uploader and downloader interfaces for test purposes
Author: Metaplex Maintainers
Latest version: 0.9.1

# umi-storage-mock

A mock implementation of the uploader and downloader interfaces for test purposes.

## Installation

```sh
npm install @metaplex-foundation/umi-storage-mock
```
npm package: @stay.hungry07212/umi-transaction-factory-web3js
Description: A transaction factory implementation relying on Solana's web3.js
Author: Metaplex Maintainers
Latest version: 0.9.1

# umi-transaction-factory-web3js

A transaction factory implementation relying on Solana's web3.js.

## Installation

```sh
npm install @metaplex-foundation/umi-transaction-factory-web3js
```
npm package: @stay.hungry07212/umi-uploader-bundlr
Description: An uploader implementation relying on Bundlr
Author: Metaplex Maintainers
Latest version: 0.9.1

# umi-uploader-bundlr

An uploader implementation relying on Bundlr.

## Installation

```sh
npm install @metaplex-foundation/umi-uploader-bundlr
```
npm package: @stay.hungry07212/umi-uploader-nft-storage
Description: An uploader implementation relying on NFT.Storage
Author: Metaplex Maintainers
Latest version: 0.9.1

# umi-uploader-nft-storage

An uploader implementation relying on NFT.Storage.

## Installation

```sh
npm install @metaplex-foundation/umi-uploader-nft-storage
```
npm package: @stay.hungry07212/umi-web3js-adapters
Description: A helper package to transform web3.js types to and from umi types
Author: Metaplex Maintainers
Latest version: 0.9.1

# umi-web3js-adapters

A helper package to transform web3.js types to and from umi types.

## Installation

```sh
npm install @metaplex-foundation/umi-web3js-adapters
```
npm package: @stayer/injection
Description: Dependency injection of the Stayer framework.
Author: Anton Bakhurynskyi
Latest version: 0.0.8

# @stayer/injection

Dependency injection module for the Stayer framework.

## Usage example

The simplest way to instantiate a dependency injection is to declare a dependency class as ```Injection```:

```
import { Injection } from '@stayer/injection';
import got = require('got');

@Injection()
export class SomeAPI {
  private url = 'https://external-service.com/api/';

  async performRequest(data: any) {
    return await got.post(this.url, { body: data, json: true });
  }
}
```

Now inject the ```SomeAPI``` class into dependent class:

```
import { Injection } from '@stayer/injection';
import { SomeAPI } from './some-api';

@Injection()
export class SomeService {
  constructor(private api: SomeAPI) {}

  async execute() {
    return await this.api.performRequest({ foo: "bar"});
  }
}
```

**Note**: dependent class must also have the ```@Injection()``` decorator.

Now, how to get the injected instances of describe class? Via global ```injector``` object which is an instance of ```Injector``` type:

```
import { injector } from '@stayer/injection';

import { SomeService } from './some-service';

const service = injector.getInstance(SomeService);
service.execute().then( // HTTP request is performed
  response => {
    console.log(response);
  }
);
```
npm package: @stayer/interfaces
Description: Common interfaces, types, errors & exceptions of the Stayer framework.
Author: Anton Bakhurynskyi
Latest version: 0.0.17

# @stayer/interfaces

A module that contains common interfaces, types, enums, errors & exceptions used by other modules of the Stayer framework.

## Public API

1) ```Exception``` - an abstract class to extend default Error Node.js class.

2) ```HttpError``` - an abstract Exception representing any HTTP error status.

### Http exceptions:

3) ```BadRequest``` - BadRequest (400) Exception

4) ```Unauthorized``` - Unauthorized (401) Exception

5) ```Forbidden``` - Forbidden (403) Exception

6) ```NotFound``` - NotFound (404) Exception

7) ```MethodNotAllowed``` - MethodNotAllowed (405) Exception

8) ```Conflict``` - Conflict (409) Exception

9) ```InternalServerError``` - InternalServerError (500) Exception

10) ```NotImplemented``` - NotImplemented (501) Exception

More HTTP Exceptions can be added by extending the ```HttpError``` abstract class.
npm package: @stayer/routing
Description: Routing module of the Stayer framework.
Author: Anton Bakhurynskyi
Latest version: 0.0.13

# @stayer/routing

Routing module of the Stayer framework.

## Usage example

To create a service with some endpoints, first you need to declare a ```Service``` class, and then mark some of its methods as endpoints (```Get``` or ```Post```):

```
import { Get, Post, Service } from '@stayer/routing';

@Service()
export class SomeService {
  private items: object[] = [];

  @Get('/items')
  getAll(req, res, body, query) {
    return this.items; // these are returned in HTTP response with status 200
  }

  @Post('/item')
  createItem(req, res, body, query) {
    const newItem = body.item;
    this.items.push(newItem);
    res.statusCode = 201; // let's return a Created HTTP status
    return newItem; // returning newly created item in response
  }
}
```

## Public API

- Service() - a service class decorator. All classes containing endpoint decorators must be marked as ```@Service()```.

- Get(route: string) - a GET endpoint method decorator. Will be available via HTTP with your server base URL (in our example for all items: ```http://localhost:3000/items```).

- Post(route: string) - a POST endpoint method decorator. Will be available via HTTP with your server base URL (in our example for new item: ```http://localhost:3000/item``` (POST)).

All endpoint methods accept 4 parameters:

@Get('/')
async myEndpoint(req, res, body, query) {
  return await { foo: 'bar' };
}

- req: IncominMessage - a Node.js request object;
- res: ServerResponse - a Node.js response object;
- body?: object - a JSON-parsed request body, can be undefined;
- query?: object - parsed URL-query, can be undefined.

Note that an endpoint decorator is able to return values asynchronously.