pixelwalker.js v1.4.11
npm i --save pixelwalker.js
Example: Connecting
import "dotenv/config";
import { APIClient, Block } from "pixelwalker.js";
const client = APIClient.withToken(process.env.TOKEN!)!;
const game = await client.createGame("r450e0e380a815a");
game.listen("Init", () => {
console.log("Init!");
});
game.bind();
Using in the browser
Per default, this library will not work in the browser without downloading the polyfill node modules, below is an example how you can achieve this using the vite-plugin-node-polyfills module, which will help with bundling node-native, which this library uses: events
npm i --save pixelwalker.js
npm i --save-dev vite-plugin-node-polyfills
// vite.config.ts
import { defineConfig } from 'vite'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
export default defineConfig({
plugins: [
nodePolyfills({
include: ['events'],
globals: { process: true },
}),
],
})
Contribution
npm install # Install `node_modules`
npm run build # Execute this after making changes to the library.
Installing the node packages will also build the project into dist.
7 months ago
4 months ago
5 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
7 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
11 months ago
11 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago