open-index/open-npm huggingface dataset:
npm package: @musaid.qa/openai-socket
Description: A wrapper for the OpenAI API using sockets
Author: Mohamed Ali
Latest version: 0.0.3

# OpenAI Socket

A wrapper for the OpenAI API using sockets.

[![npm version](https://img.shields.io/npm/v/@musaid.qa/openai-socket.svg)](https://www.npmjs.com/package/@musaid.qa/openai-socket)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)

## Installation

Install the package using npm:

```bash
npm install @musaid.qa/openai-socket
```

## Usage

![Example](https://github.com/mymusaid/openai-socket/blob/main/.github/example.gif)

### Server

```typescript
import { Server } from "socket.io";
import { OpenAISocket } from "@musaid.qa/openai-socket";


const server = new Server();
const port = 2030;
const openai = new OpenAISocket(server, {
  verbose: true,
  client: {
    apiKey: process.env.OPENAI_API_KEY
  },
  chat: {
    model: 'gpt-3.5-turbo'
  },
  initMessages: [
    {
      role: 'system',
      content: 'You are a nodejs compiler'
    }
  ]
});

server.listen(port);
console.log(`Listening on port ${port}`);

```

### Client

```typescript
import { Socket, io } from "socket.io-client"
import { EmitEvents } from "@musaid.qa/openai-socket";

const client: Socket<EmitEvents> = io('http://localhost:2030');

client.on('connect', () => {

  client.on('content', (content) => {
    console.log(content)
  });

  client.on('end', () => {
    console.log('end')
  });

 client.emit('new-message', 'Hello from earth!');

});

```

For more see [basic example](/src/examples/basic/) or [Docs](https://openai-socket.docs.mymusaid.com)

## License

This project is licensed under the MIT License.
npm package: @musaka/node-wechat-api
Description: node.js implement of wechat api
Author: musaka
Latest version: 0.3.2

# node-wechat-api

node.js implement of wechat api

## What node-wechat-api does

This project will get and save access_token and jsapi_ticket to independent files(token and wxjstk) every 7000s(7200 expire time). As well as provide ways to get the parameter that one will need when using wechat's JS-SDK. More info can be find at https://mp.weixin.qq.com/wiki

### Prerequisites

This is a Node.js module so you konow what I mean........
You will need to get your own appID and appsecret and set corresponding js url on wechat open plateform. Btw you can get a test accound that allow you to test all their apis, check here: https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login.

### Installing

1.install using npm

```
npm install @musaka/node-wechat-api
```

2.Create wechat-config.json under your project's root and put your appID and appsecret info in it.

```
//wechat-config.json
{
  "appId": "your appid here",
  "appSecret": "your appSecret here"
}
```

3.Create a token file under root directory.(as of 0.2.4, might not need in future versions)

4.In your project, require the module, and it will automatically refresh access_token and jsapi_ticket in token and wxjstk every 7000s. If you need to implement wechat's JS-SDK, you can call cjsconfig(url) function(url is the page url where you want to use JS-SDK). This function will return appid, timestamp, nonceStr, signature that you will need to pass to the wx.config in pages that need wechat's JS-SDK.
```
const wechatapi = require('@musaka/node-wechat-api')
app.get('/tools/bmi',function(req, res){
	const clientUrl = 'http://' + req.hostname + req.url;
	const jsconfig = wechatapi.cjsconfig(clientUrl);
	res.render('pages/tools/bmi',{title:'Body Mass Index', ai: jsconfig.appid, ts:jsconfig.timestamp, ns: jsconfig.nonceStr, sg:jsconfig.signature });
});
```
npm package: @musakui/fedi
Description: tools for the fediverse
Author: musakui
Latest version: 0.3.1

# fedi

> tools for the fediverse

[![npm](https://img.shields.io/npm/v/@musakui/fedi.svg)](https://www.npmjs.com/package/@musakui/fedi)

**Warning** this is still experimental and APIs are expected to change a lot

This project houses the low-level interfaces to interact with the Fediverse. It aims to be
- buildless (ESM)
- isomorphic (run in browser and Node)
- typed (with [JSDoc](https://jsdoc.app) annotations and TS declarations)

Documentation will be lacking, so please refer to [kotori](https://github.com/musakui/kotori) for usage examples.

## Modules
These are the main components. Please suggest more if you think they should be added.

### [ActivityPub](https://activitypub.rocks) (and ActivityStreams)
The core protocol for federated social networking. For a quick rundown, this [highly opinionated guide to learning about ActivityPub](https://tinysubversions.com/notes/reading-activitypub) is highly recommended.

Similar libraries
- [michaelcpuckett/activitypub-core](https://github.com/michaelcpuckett/activitypub-core)
- [activitypub-js/activitypub-models](https://github.com/activitypub-js/activitypub-models)

### `.well-known` endpoints
Some [Well-known URIs](https://en.wikipedia.org/wiki/Well-known_URI) have been defined for easy communication between services. The main ones are [WebFinger](https://webfinger.net) (to lookup handles) and [NodeInfo](https://github.com/jhass/nodeinfo) (server metadata).

### HTTP Signatures (and Keys)
To verify messages across services, HTTP requests are signed with keys.

**Note** There is some code for hs2019 but take note that it is not well supported
npm package: @musakui/kaizoku
Description: download HLS video
Latest version: 0.0.3

# kaizoku

> download HLS video

[![npm](https://img.shields.io/npm/v/@musakui/kaizoku.svg)](https://www.npmjs.com/package/@musakui/kaizoku)

## usage

```js
import { Readable } from 'node:stream'
import { createWriteStream } from 'node:fs'
import { HlsVideo } from '@musakui/kaizoku'

const video = new HlsVideo('[playlist url]', { key: '[key]' })
Readable.from(video).pipe(createWriteStream('video.m2ts'))

// iterate manually to track progress
const writeStream = createWriteStream('video.m2ts')

for await (const chunk of video) {
	writeStream.write(Buffer.from(chunk))

	// notify progress
	// ...
}
```