open-index/open-npm huggingface dataset:
npm package: @psdk/cpcl
Description: psdk - cpcl command sdk
Latest version: 0.7.15

@psdk/cpcl
===

```
npm i @psdk/cpcl
```

<!--harmony-->

## How to use

```js
const cpcl = CPCL.generic(lifecycle);
const reporter = await cpcl
  .raw(Raw.binary(new Uint8Array([0x10, 0xff, 0xbf])))
  .write({chunkSize: 512});
```
npm package: @psdk/device-ble-taro
Description: psdk - device ble with taro
Latest version: 0.7.15

@psdk/device-ble-taro
===

```
npm i @psdk/device-ble-taro
```

<!--harmony-->

## How to use

```js
const bluetooth = new TaroBleBluetooth({});
bluetooth.discovered(async (devices) => {
  // ...
});

await bluetooth.startDiscovery();
```
npm package: @psdk/device-ble-uniapp
Description: psdk - device ble with uniapp
Latest version: 0.7.15

@psdk/device-ble-uniapp
===

```
npm i @psdk/device-ble-uniapp
```

<!--harmony-->

## How to use

```js
const bluetooth = new UniappBleBluetooth({});
bluetooth.discovered(async (devices) => {
  // ...
});

await bluetooth.startDiscovery();
```
npm package: @psdk/device-ble-wechat
Description: psdk - device ble with wechat
Latest version: 0.7.15

@psdk/device-ble-wechat
===

```
npm i @psdk/device-ble-wechat
```

<!--harmony-->

## How to use

```js
const bluetooth = new WechatBleBluetooth({});
bluetooth.discovered(async (devices) => {
  // ...
});

await bluetooth.startDiscovery();
```
npm package: @psdk/device-bluetooth-traits
Description: psdk - device bluetooth traits
Latest version: 0.7.15

@psdk/device-bluetooth-traits
===

```
npm i @psdk/device-bluetooth-traits
```

<!--harmony-->

## How to use

```js
export class YourDeviceBluetooth extends Jluetooth<string> {
  isConnected(): boolean {};

  bluetoothAdapterState(): Promise<BluetoothAdapterState> {}

  startDiscovery(): Promise<void> {}

  stopDiscovery(): Promise<BasicMessage> {}

  discovered(callback: (devices: Array<JluetoothDevice<DEVICE>>) => Promise<void>): void {}

  connect(device: JluetoothDevice<DEVICE>, options?: ConnectOptions): Promise<ConnectedDevice> {}
}
```
npm package: @psdk/device-webusb
Description: psdk - device webusb
Latest version: 0.7.15

@psdk/device-webusb
===

```
npm i @psdk/device-webusb
```

<!--harmony-->

## How to use

```js
const webusb = Webusb.withFilter({
  vendorId: 1234,
  productId: 5678,
});
await webusb.connect();
```
npm package: @psdk/esc
Description: psdk - esc command sdk
Latest version: 0.7.15

@psdk/esc
===

```
npm i @psdk/esc
```

<!--harmony-->

## How to use

```js
const esc = ESC.generic(lifecycle);
const reporter = await esc
  .raw(Raw.binary(new Uint8Array([0x10, 0xff, 0xbf])))
  .write({chunkSize: 512});
```
npm package: @psdk/frame-father
Description: psdk - frame father basic interface and common types
Latest version: 0.7.15

@psdk/frame-father
===

```
npm i @psdk/frame-father
```

<!--harmony-->


## How to use


- Add your custom command extend `PSDK`
- Add your custom device extend `ConnectedDevice`


### Commander

```js
const command = Commander.make()
  .pushText('TEXT COMMAND')
  .pushBinary(new Uint8Array([0x00, 0x01]))
  .pushClause(CommandClause.text('ANOTHER TEXT COMMAND'))
  .command();
const hex = command.hex(HexOutput.formatWithMaxLength(8));
console.log(hex);
```
npm package: @psdk/frame-imageb
Description: psdk - imageb sdk, process image
Latest version: 0.7.15

@psdk/frame-imageb
===

```
npm i @psdk/frame-imageb
```

<!--harmony-->

## How to use

Image processing algorithms

### grayscale iamge

```js
const processer = new GrayscaleImage();
const processered = processer.process(await readImage());
const img = processered.result.data.toDataURL();
console.log(img);
```
npm package: @psdk/ohos-bluetooth-classic
Description: psdk - ohos bluetooth classic device support
Latest version: 0.7.15

@psdk/ohos-bluetooth-classic
===

```
npm i @psdk/ohos-bluetooth-classic
```

<!--harmony-->

## How to use

```js
const bluetooth = new OhosBluetoothClassic({});
bluetooth.discovered(async (devices) => {
  //connect bluetooth
  const connectDevice = await bluetooth.connect(device[0]);
  //init device
  PrinterUtil.getInstance().init(connectDevice);
  //send data
  const report = await PrinterUtil.getInstance().cpcl()
    .raw(Raw.binary(Uint8Array.from([0x10, 0xff, 0xbf])))
    .write();
});
//discovery
await bluetooth.startDiscovery();
```
npm package: @psdk/ohos-bluetooth-classic-raw
Description: psdk - ohos bluetooth classic device support
Latest version: 0.7.15

@psdk/ohos-bluetooth-classic-raw
===

```
npm i @psdk/ohos-bluetooth-classic-raw
```

<!--harmony-->

## How to use

```js
const bluetooth = new RawOhosBluetoothClassic({});
bluetooth.discovered(async (devices) => {
  //connect bluetooth
  const connectDevice = await bluetooth.connect(device[0]);
  //init device
  PrinterUtil.getInstance().init(connectDevice);
  //send data
  const report = await PrinterUtil.getInstance().cpcl()
    .raw(Raw.binary(Uint8Array.from([0x10, 0xff, 0xbf])))
    .write();
});
//discovery
await bluetooth.startDiscovery();
```
npm package: @psdk/ohos-bluetooth-le
Description: psdk - ohos bluetooth le device support
Latest version: 0.7.15

@psdk/ohos-bluetooth-le
===

```
npm i @psdk/ohos-bluetooth-le
```

<!--harmony-->

## How to use

```js
const bluetooth = new OhosBluetoothLe({});
bluetooth.discovered(async (devices) => {
    //connect bluetooth
  const connectDevice = await bluetooth.connect(device[0]);
  //init device
  PrinterUtil.getInstance().init(connectDevice);
    //send data
  const report = await PrinterUtil.getInstance().cpcl()
    .raw(Raw.binary(Uint8Array.from([0x10, 0xff, 0xbf])))
    .write();
});
//discovery
await bluetooth.startDiscovery();
```
npm package: @psdk/ohos-network
Description: psdk - ohos network device support
Latest version: 0.7.15

@psdk/ohos-network
===

```
npm i @psdk/ohos-network
```

<!--harmony-->

## How to use

```js
// connect network
const network = new OhosNetwork();
const connectDevice = await network.connect(this.address,this.port);
// init device
PrinterUtil.getInstance().init(connectDevice);
// send data
const report = await PrinterUtil.getInstance().cpcl()
  .raw(Raw.binary(Uint8Array.from([0x10, 0xff, 0xbf])))
  .write();
```
npm package: @psdk/ohos-usb
Description: psdk - ohos usb device support
Latest version: 0.7.15

@psdk/ohos-usb
===

```
npm i @psdk/ohos-usb
```

<!--harmony-->

## How to use

```js
//open usb
const usb = new OhosUsb();
const connectDevice = usb.openUsb();
// init device
PrinterUtil.getInstance().init(connectDevice);
// send data
const report = await PrinterUtil.getInstance().cpcl()
  .raw(Raw.binary(Uint8Array.from([0x10, 0xff, 0xbf])))
  .write();
```
npm package: @psdk/tspl
Description: psdk - tspl command sdk
Latest version: 0.7.15

@psdk/tspl
===

```
npm i @psdk/tspl
```

<!--harmony-->

## How to use

```js
const tspl = TSPL.generic(lifecycle);
const reporter = await tspl
  .page({width: 100, height: 180})
  .write({chunkSize: 512});
```