open-index/open-npm huggingface dataset:
npm package: @rockart/marketsale
Description: MarketSale Smart Contract.
Latest version: 0.0.1

# ERC721 utility to check NFT sales

When posting a token collection for sale on OpenSea or Blur, you can check whether it is a token **sale** or **transfer**.

```solidity
import '@rockart/marketsale/MarketSale.sol';

contract TestNFT is MarketSale {
    // ...
}
```

```solidity
/**
* @dev Returns the address of the marketplace where the sale is tracked.
*/
function getMarket(uint256 id) external view returns (address);

/**
* @dev Adding a new marketplace address to track the sale.
*/
function addMarket(address[] memory markets) external;

/**
* @dev Removing the marketplace from sales tracking.
*/
function delMarket(address[] memory markets) external;

/**
* @dev Returns a logical value,
* `true` if the NFT is sale and
* `false` if it is a transfer.
*/
function isSale() external view returns (bool sale);
```

## Do not use in production!

- Do not test multiple sales;
- Do not test multiple transfers;
npm package: @rockband/vue
Description: A Vue.js component library based on TailwindCSS
Author: Thom Bruce
Latest version: 0.9.2

# RockBand

## Features

RockBand is a Nuxt component library that comes with:

- [Nuxt Image](https://image.nuxtjs.org/)
- [Pug](https://pugjs.org/api/getting-started.html)
- [Tailwind CSS](https://tailwindcss.com/) + [Tailwind CSS Forms](https://github.com/tailwindlabs/tailwindcss-forms)
- [PostCSS](https://postcss.org/)
- [Font Awesome](https://fontawesome.com/)
- [Simple Icons](https://simpleicons.org/)
- [Lodash](https://lodash.com/)
- [Nuxt Taxonomies](https://github.com/thombruce/nuxt-taxonomies)

These are used to create a base set of components and plugins for my Nuxt projects.

## Installation

Add RockBand to your project:

```sh
yarn add --dev @rockband/nuxt
```

Add RockBand to buildModules in `nuxt.config.js`:

```js
buildModules: [
  '@rockband/nuxt'
]
```

## Overwrite Default Styles

Create a CSS file at `assets/css/rockband.css` and import `@rockband/vue`:

```css
@import "@rockband/vue";

/* Declare your styles or local imports here. */
```

RockBand comes with Tailwind CSS and PostCSS; you can count on both of them working for this file and its imports. And of course, you can just write plain old CSS.

You can also configure `tailwind.config.js` following their docs. Apart from the `rockband.css` file, it's just like any other Tailwind installation.
npm package: @rockchalkwushock/eslint-config
Description: My eslint config for working with React & TypeScript.
Author: Cody Brunner
Latest version: 1.0.7

# @rockchalkwushock/eslint-config

My eslint config for working with React & TypeScript.

Heavily based on [eslint-config-react-app](https://www.npmjs.com/package/eslint-config-react-app).

## Usage

```shell
yarn add -D @rockchalkwushock/eslint-config eslint prettier typescript
```

```json
{
  "extends": ["@rockchalkwushock/eslint-config"]
}
```
npm package: @rockcontent/extended-yaml-brunch
Description: Add the ability to import one or more complex YAML files (with js functions, dates, regexp, ...) as objects in a defined namespace for use in javascript
Author: Silvio Henrique Ferreira
Latest version: 1.8.1

## extended-yaml-brunch
A [brunch](http://brunch.io) plugin to transform complex YAML files into JS object at a given location of the application.
It handles complex YAML data such as functions, regexps, udnefined and dates

## Usage
### Install
Add `"extended-yaml-brunch": "x.y.z"` to `package.json` of your brunch app.
Pick a plugin version that corresponds to your minor (y) brunch version.

If you want the latest repository version, install the plugin by running the following command:
```sh
npm install --save "git+ssh://git@github.com:huafu/extended-yaml-brunch.git"
```

### Usage in your application
Usage:

```coffeescript
sysPath = require 'path'

module.exports =
  #...
  extendedYaml:
    # Name mapper, if you need the YAML data to be defined on a specific variable/namespace.
    # The default is to not set it and just allow you to do `require('config/user');` to
    # access the whole YAML data as a JS object.
    # It has to return an array which gonna be join with '.' or directly the path where to
    # define the data: 'SomeNamespace.config.here'
    # If it returns `null` then it'll not define it anywhere
    # So if you want `app/config/user.yml` to be defined on window.MyCompany.config.user
    # you can define that config as function like this:
    jsPathForFile: (path, parts) ->
      # for the file under `app/config/user.yml` you'll have:
      # path: 'app/config/user.yml'
      # parts: ['app', 'config', 'user']
      # here we don't want the first part (app) and we want to prepend with 'MyCompany'
      ['MyCompany'].concat parts[1..]
```
npm package: @rockcoolsaint/progress-bar
Description: # Installation npm install @rockcoolsaint/progress-bar yarn add @rockcoolsaint/progress-bar
Author: Innocent Onyemaenu
Latest version: 1.0.1

# progress-bar

# Installation
npm install @rockcoolsaint/progress-bar
yarn add @rockcoolsaint/progress-bar

## Features
*  Vertical progress bar
*  Horizontal progress bar
*  Very customizable

## Usage
Basic usage:
This is by default a progress bar and it is vertical
The progress bar fills up whatever container parent container
```
<div style={{height: '20rem'}}>
    <ProgressBar />
</div>
```

Props: 
* bgColor: string (optional)
* percentage: number (optional)
* mode: string (optional)
* progressText: boolean (optional)
* progressTextColor: string (optional)

Examples
```
<ProgressBar
    bgColor="#e916a1",
    percentage=90,
    mode="vertical",
    progressText=true,
    progressTextColor="white",
    width='3rem'
/>
```

Horizontal progress bar
```
<ProgressBar
    bgColor="green",
    percentage=90,
    mode="horizontal",
    progressText=true,
    progressTextColor="white"
/>
```

If you having difficulty, don't hesitate to send me a mail at rockcoolsaint@gmail.com
npm package: @rockdog/directus-extension-endpoint-google-place
Description: A Directus extension to fetch Google Places data
Author: Rock Dog Interactive
Latest version: 2.0.3
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# Directus Google Place Endpoint

This is a custom endpoint for Directus that allows you to retrieve place data from the Google Places API.

## Installation:

Ensure your Directus project is configured for Redis.

https://docs.directus.io/self-hosted/config-options.html#redis

Add the following environment variables to your project:

```env
GOOGLE_API_KEY=your-google-api-key
GOOGLE_PLACE_ID=your-google-place-id

REDIS_DGPE_CACHE_KEY=your-redis-dgpe-cache-key
REDIS_DGPE_CACHE_HOURS=your-redis-dgpe-cache-hours
```

## Usage

You can use this endpoint to retrieve place data from the Google Places API.

```http
GET /google-place
```

## Notes

This plugin currently retrieves the following data:

-   id
-   plusCode
-   googleMapsUri
-   internationalPhoneNumber
-   adrFormatAddress
-   regularOpeningHours
-   currentOpeningHours
-   reviews

In the future I would like to add a configuration panel to customize data requests.
npm package: @rockdog/directus-extension-google-place
Description: A Directus extension to fetch Google Places data
Author: Rock Dog Studios
Latest version: 1.1.2

# Directus Google Place Endpoint

This is a custom endpoint for Directus that allows you to retrieve place data from the Google Places API.

## Installation:

Ensure your Directus project is configured for Redis.

https://docs.directus.io/self-hosted/config-options.html#redis

Add the following environment variables to your project:

```env
GOOGLE_API_KEY=your-google-api-key
GOOGLE_PLACE_ID=your-google-place-id

REDIS_DGPE_CACHE_KEY=your-redis-dgpe-cache-key
REDIS_DGPE_CACHE_HOURS=your-redis-dgpe-cache-hours
```

## Usage

You can use this endpoint to retrieve place data from the Google Places API.

```http
GET /google-place
```

## Notes

This plugin currently retrieves the following data:

-   id
-   plusCode
-   googleMapsUri
-   internationalPhoneNumber
-   adrFormatAddress
-   regularOpeningHours
-   currentOpeningHours
-   reviews

In the future I would like to add a configuration panel to customize data requests.
npm package: @rockdog/directus-extension-vector-store
Description: A Directus extension to integrate vector storage capabilities
Author: Rock Dog Studios
Latest version: 1.3.3

# Directus Extension: Vector Store

The **Directus Extension: Vector Store** is a plugin designed to manage the processing and storage of document embeddings for vector search capabilities. This extension can extract, process, and store document data in Redis, allowing vector-based queries to be performed efficiently.

## Features

- Supports both file and URL-based document processing.
- Embeds and stores document data into a Redis vector store.
- Provides endpoints to manage, process, and retrieve processed files.
- Includes UI components for uploading files and displaying processed data.
- Performs health checks to ensure service readiness.

## Installation

1. **Install via npm:**
   Ensure you have Node.js installed, then run:

   ```bash
   npm install directus-extension-vector-store
   ```

2. **Configure Environment:**
   Set up the necessary environment variables:

   ```plaintext
   REDIS=redis://your_redis_url
   RAG_INDEX=your_index_name
   LLM_URL=your_llm_url
   LLM_EMBEDDING=your_llm_embedding
   ```

## Usage

- **File Processing:** Upload files via the `/embed-vector` endpoint. This accepts a single file upload, processes it, splits it into chunks, and stores the embeddings in Redis.
- **Health Check:** Use other mechanisms, such as basic server response validation (e.g., hitting the root endpoint).
- **List Vectors:** Retrieve metadata of processed files using the `/get-vectors` endpoint.
- **Delete Vectors:** Remove specific documents from the vector store using the `/del-vector` endpoint.

### Endpoints

- **`/embed-vector`**: POST request to upload and process a file into embeddings.
- **`/get-vectors`**: GET request to retrieve a list of processed vector metadata.
- **`/del-vector`**: DELETE request to remove a specific vector from storage.
- **`/`**: Basic GET request returning "Hello World!" to ensure the server is running.

## Contributing

Contributions are welcome! Fork the repository and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.

## License

This extension is licensed under the MIT License.
npm package: @rocker.js/core
Description: A lightweight ioc container for node.js
Author: yangli
Latest version: 1.0.0

# rocker
轻量级的IOC框架,

## Usage
安装 npm install @vdian/rocker

## 代码示例
```javascript
import {Container} from '@vdian/rocker';

class User{
    id:string = 'testId';
    name:string = 'testName';
}

abstract class UserService{
    abstract  getUser(id:string):User;
}


// 1. 注册Provider(实现类 或 工厂)
// 形式一：形如 Container.provides(class extends UserService{})
Container.provides(class extends UserService {
   async getUser(_id: string): User {
       return new User();
   }
});

//或者

// 形式二：形如 Container.provides([UserService,FactoryFunction])
Container.provides([UserService,() => {
    return new class extends UserService {
          async getUser(_id: string): User {
              return new User();
          }
       }();
}]);

// 2. 依赖注入

class Control{
    @Inject
    userService:UserService;
    
    test(){
        let user:User = this.userService.getUser();
        console.log(user);
    }
}

(new Control()).test();

```

## 场景:RPC调用
```javascript
import {Container, Inject} from '@vdian/rocker'

//PRC Demo实现
let RPC = {
    config: function (_cfg: { serviceUrl: string, interfaces: Function[] }) {
        if (_cfg.interfaces) {
            _cfg.interfaces.forEach((_type: FunctionConstructor) => {
                if (_type.prototype) {
                    let newObj = {}, proto = _type.prototype;
                    let nms = Object.getOwnPropertyNames(proto);
                    if (nms) {
                        nms.forEach((nm) => {
                            if (nm != 'constructor' && typeof(proto[nm]) === 'function') {
                                newObj[nm] = function () {
                                    ////{nm:方法名,arguments:参数表},改为调用远程请求过程
                                    return arguments[0];//test return
                                }
                            }
                        })
                    }
                    Container.provides([_type, () => {
                        return newObj;
                    }])
                }
            })
        }

    }
}

//--DEMO--------------------------------------------------------

//1. 接口声明（注意,此处只能使用Concrete class）
class Product {
    getById(id: string): string {
        return null;
    }
}

//2. 应用RPC Framework
RPC.config({
    serviceUrl: null,
    interfaces: [Product]//提供接口描述，在RPC中构建factory
})

//3. Service class
class Service {
    @Inject
    product: Product;

    test() {
        let id: string = 'tid';
        let rst = this.product.getById(id);
        console.log(rst);
    }
}

//4.测试
new Service().test();
```
npm package: @rockerapp/flake
Description: Time-based, unique 64-bit ID generator, inspired by Twitter's Snowflake
Latest version: 2.1.1

# Flake

A module to generate time-based 64-bit unique IDs, inspired by Twitter's Snowflake ID system.

Flake is generated by concatenating:
- a 42-bit timestamp,
- a 10-bit node ID (or any random number you provide), and
- a 12-bit sequential number.

Because of JavaScript's 53-bit integer precision limit, Flake generates a [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) like `285124269753503744n`, which can be easily be type-cast as a 64-bit bigint in a database.

## Usage

### Initialize
```js
import Flake from '@rockerapp/flake'

// initialize Flake instance
// all settings are optional
const flake = new Flake({
	nodeId: 42, // optional, define machine ID
	timeOffset: (2020-1970)*31536000*1000 // optional, define a time offset
})
```

Create a instance of Flake as shown above, which will be used to generate IDs afterward.

### Generate ID
```js
const id1 = flake.generate() // returns something like 285124269753503744n
const id2 = flake.generate() // returns something like 285124417543999488n
```

## Options

**`nodeId`** (number, default: `1`)

A machine ID or any random number. If you are generating IDs on multiple nodes, it's highly advised to pass a proper node ID that is unique to the machine.

---

**`timeOffset`** (number, default: `0`)

Time to be subtracted from current timestamp (based on the Unix epoch) to determine the first 42 bits of ID.

## Functions

**`generate()`** (string)

Returns a stringified **`generateRaw()`** output.

---

**`generateRaw()`** (BigInt)

Generates an ID based on the options passed to the Flake instance.

## License

Flake is distributed under the MIT license. Originally created by Sudhanshu Yadav, with help from [other contributors](https://github.com/rockerapp/flake/graphs/contributors).

See LICENSE file for license text.
npm package: @rockerjs/dao
Description: Database access object framework, support transaction
Author: Chemingjun, yangli
Latest version: 1.0.1

# ROCKER-MVC

## 一、快速上手

### 初始化项目目录

+   安装 Node.js（v8.9.3+）

    https://nodejs.org/en/

+   安装 vbuilder 命令行

    ```shell=
    [sudo] npm i @vdian/vbuilder-cli --registry http://npm.idcvdian.com
    ```

+   进入项目目录（名称任意）

    ```shell=
    mkdir rocker-mvc-project

    cd rocker-mvc-project
    ```

+   执行命令 `v`，根据提示依次完成：项目初始化、启动本地开发环境

    项目初始化完成后，也可以执行 `npm run dev` 启动本地开发环境

### 启动开发环境

```javascript=
npm run dev
```

## 二、API

所有 API 挂载在引入的 MVC 对象下，而且可以串行调用
```javascript=
MVC.route({
    '/home': import('./home')
}).start()
```

### start

> 接收参数：
> - { port: number }

在添加路由以及中间件后启动服务
```javascript=
MVC.pipe(middleWare).route({ }).start()
```

### route

> 接收参数：
> - RouterMap => { [index: string]: Function } | { [index: string]: Promise<any> };
> - RouterRegType => { all: RouterMap, render?: { start: string, end: string } }

为应用添加路由处理方法，参数示例如下：

```javascript=
// 1. RouterMap
MVC.route({
    '/home': import('./home'),
    '/about': import('./about')
})

// 2. RouterRegType
// 为所有的路由添加公有的 header 和 footer 脚本
MVC.route({
    all: {
        '/home': import('./home'),
        '/about': import('./about')
    },
    render: {
        start: './header.ejs',
        end: './footer.ejs'
    }
})

```

### pipe
> 接收参数:
> - Koa 中间件

Rocker MVC 可以任意使用Koa的中间件，示例如下：

编写 logRequest 中间件
```javascript=
function log( ctx ) {
    console.log( ctx.method, ctx.header.host + ctx.url )
}

export default function () {
    return async function ( ctx, next ) {
        log(ctx);
        await next()
    }
}
```

通过 pipe 来引入中间件
```javascript=
import logRequest from './logRequest'

MVC.pipe(logRequest()).route({ }).start()
```

## 三、TypeScript 介绍

全局安装 typescript 编译器

```shell=
npm i -g typescript
```

编写 ts 配置文件 tsconfig.json

```shell=
{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es6",
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "noImplicitAny": false,
        "allowJs": true,
        "inlineSourceMap": true
    },
    "exclude": [
        "node_modules",
        "coverage"
    ]
}
```

执行编译操作

```shell=
tsc .
```

## 四、TODO
- route 现在只接收 import 进来的模块
- 完善单元测试
- 添加测试覆盖率
- push 前挂载集成测试钩子
npm package: @rockerjs/mvc
Description: A MVC framework based on Rockerjs/core used by node.js
Author: yangli
Latest version: 1.0.12

# Rockerjs MVC
[![Build Status](https://travis-ci.org/weidian-inc/rockerjs-core.svg?branch=dev)](https://travis-ci.org/weidian-inc/rockerjs-core)
[![Coverage Status](https://coveralls.io/repos/github/weidian-inc/rockerjs-core/badge.svg?branch=dev)](https://coveralls.io/github/weidian-inc/rockerjs-core?branch=dev)
[![npm package](https://img.shields.io/npm/v/@rockerjs/core.svg)](https://www.npmjs.org/package/@rockerjs/core)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)

- [项目主页](https://rockerjs.weidian.com/compass/mvc.html)
- [实例尝鲜](https://github.com/weidian-inc/rockerjs-demo)

## 简介

Rockerjs-MVC是一套基于配置、具有轻量级容器特性且集成了链路追踪功能的Node.js Web应用框架。

Rockerjs-MVC的容器特性可极致简化你的代码，帮助你快速构建高效、可扩展的应用程序。它采用DI（Dependency Inject）和OOP（Object Oriented Programming）的理念，遵循 **“配置大于约定”** 的规范，同时提供 **Starter机制** 实现“模块粒度下配置与约定的融合” ，使用TypeScript强类型语言构建你的应用。

> Rockerjs-MVC的所有功能都是基于一个遵循**ini配置规范**的 "app.${env}.config" 文件来实现的，可提供四种不同环境的配置文件：dev、daily、pre、prod

> 轻量级容器特性意味着Rockerjs-MVC可管理所有注解标识类的实例化对象，并管理其生命周期、对象间的依赖关系；当使用这些对象时可通过注解直接引用，无需手动实例化或建立对象间依赖。

> Starter机制提供某些模块约定俗成的配置并自动初始化，无需开发者在程序中显式操作。当默认配置无法满足时，可通过配置文件配置该Starter相关参数。Starter机制采用基于约定的准则实现，但可基于配置文件进行扩展。

## 安装

NPM:
```shell
$ npm i --save @rockerjs/mvc
```

## 使用

```typescript
import { Logger } from "@rockerjs/common";
import { Application, AbstractApplication } from "@rockerjs/mvc";

@Application
class App extends AbstractApplication {
  public async beforeServerStart(server, args: RockerConfig.Application) {
    Logger.info('beforeServerStart hook ' + args.name + args.uploadDir);
  }
  public static async main(args: RockerConfig.Application) {
    Logger.info('main bussiness '  + args.name + args.uploadDir);
  }
}
```

## 文档

[Rockerjs-MVC使用教程](https://rockerjs.weidian.com/compass/mvc.html)

## Contribute

请参考 [Contribute Guide](https://github.com/weidian-inc/rockerjs-mvc/blob/master/CONTRIBUTING.md) 后提交 Pull Request。

## License

MIT
npm package: @rockerjs/tls
Description: A threadlocal storage for node.js
Author: yangli
Latest version: 1.0.0

# Node.js's ThreadLocal -- Async Context Bound

Using Node.js's ThreadLocal to trace request information among middlewares or RPC. 

ThreadLocal in Node.js also means **"Async Context Bound"**. Because of event loop in libuv, Async Context Bound has the same effect just like threadlocal storage.

> node.js's version >= 8.9.4

## 一、快速上手

install

```sh
npm install @rockerjs/tls
```

> @rockerjs/tls only save async context wrapped in promise, #[because asyncId and triggerAsyncId related to execution timing, not causality](http://nodejs.cn/api/async_hooks.html#async_hooks_async_hooks_executionasyncid). 


示例 1

```typescript
import { ThreadLocal } from '../index';
let tls = new ThreadLocal();

tls.run(async ()=>{
    tls.setProp("traceInfo", {
        invoke: "noop"
    });
    
    await new Promise((res) => {
        setTimeout(() => {
            console.log('get Traceinfo in timer', tls.getProp("traceInfo"));
            res();
        }, 20);
    });

    setTimeout(() => {
        console.log('can\'t get Traceinfo in timer', tls.getProp("traceInfo"));
    }, 20);

    console.log('get Traceinfo in function', tls.getProp("traceInfo"))
});
```


实例2

```typescript
import { ThreadLocal } from '../index';
import * as fs from "fs";
import * as path from "path";
import * as koa from "koa";
let tls = new ThreadLocal();
var app = new koa();
var Logger = {
    info(msg) {
        console.log(msg, tls.getProp('traceId'));
    }
};

let business = async function(ctx){
    let v = await new Promise((res)=>{
        setTimeout(()=>{
            Logger.info('service执行结束')
            res(123);
        },1000);
    });
    let c = await new Promise((res, rej)=>{
        fs.readFile(path.join(process.cwd(), "package.json"), "utf8", (e,d)=>{
            if (e) {
                return rej(e);
            }
            res(d);
        });
    })
    ctx.body = 'hello world' + c;
    Logger.info(`请求返回, path: ${ctx.url}`)
};


app.use(async(ctx, next)=>{
    await tls.run(async ()=>{
        tls.setProp('traceId', Date.now())
        await business(ctx);
        Logger.info("end of callback...");
    });
    await next();
});

app.use(async(ctx, next) => {
    await tls.run(async ()=>{
        tls.setProp('traceId',123123)
        Logger.info("last filter...");
    });
});

app.listen(8088);

Logger.info(`server start, listening port 8088`);
```

## License

MIT
npm package: @rockerone/expo-xprn-sdk
Description: To install dependencies:
Author: RockerOne
Latest version: 0.0.2

# expo-xprn-sdk

To install dependencies:

```bash
bun install
```

To run:

```bash
bun run index.ts
```

This project was created using `bun init` in bun v1.1.3. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
npm package: @rocket-code/test
Description: ToolBelt 是一款专为前端开发者打造的 多功能工具包，集成多个经过验证的实用函数，覆盖 字符串处理、日期格式化、缓存管理、异步控制、数据转换 等高频开发场景。
Latest version: 0.0.1