Skip to content

Commit

Permalink
renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan-2007 committed Mar 23, 2024
1 parent 8748920 commit 9a75ada
Show file tree
Hide file tree
Showing 16 changed files with 27 additions and 28 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ jobs:

- name: Install dependencies with pnpm
run: pnpm install
working-directory: ./bambu-node
working-directory: ./bambu-link

- name: Build with tsup
run: pnpm exec tsup
working-directory: ./bambu-node
working-directory: ./bambu-link

- name: Publish to npm
run: pnpm publish --access public
working-directory: ./bambu-node
working-directory: ./bambu-link
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# bambu-node
# bambu-link
A node module for communicating with bambulab printers. Currently still a work in progress.
Only tested on p1s

## Installation
\
Install the npm package
```bash
npm i bambu-node
npm i bambu-link
# or
yarn add bambu-node
yarn add bambu-link
# or
pnpm add bambu-node
pnpm add bambu-link
# or
bun add bambu-node
bun add bambu-link
```
\
Then import bambuclient
``` javascript
import { bambuClient } from 'bambu-node'
import { connect } from 'bambu-link'
```
\
Connect to the printer
``` javascript
const client = bambuClient({
const client = connect({
hostname,
token,
serial,
Expand Down Expand Up @@ -54,15 +54,15 @@ Alot more actions will come soon
Replace token, serial, hostname with information from your printer

``` javascript
import { bambuClient } from 'bambu-node'
import { connect } from 'bambu-link'

export async function main() {

const token = '12345678' //token is found in the printer network settings
const serial = '01P00A000000000' //serial is found in the printer settings
const hostname = '192.168.0.1' //Ip address of the printer. Ip addresses can change so it is recommended to set a static ip address

const client = bambuClient({
const client = connect({
hostname, //Ip address of the printer. Ip addresses can change so it is recommended to set a static ip address for the printer
token,
serial,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions bambu-node/README.md → bambu-link/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# bambu-node
# bambu-link
A node module for communicating with bambulab printers. Currently still a work in progress.
Only tested on p1s

## Installation
\
Install the npm package
```bash
npm i bambu-node
npm i bambu-link
# or
yarn add bambu-node
yarn add bambu-link
# or
pnpm add bambu-node
pnpm add bambu-link
# or
bun add bambu-node
bun add bambu-link
```
\
Then import bambuclient
``` javascript
import { bambuClient } from 'bambu-node'
import { bambuClient } from 'bambu-link'
```
\
Connect to the printer
Expand Down Expand Up @@ -54,7 +54,7 @@ Alot more actions will come soon
Replace token, serial, hostname with information from your printer

``` javascript
import { bambuClient } from 'bambu-node'
import { bambuClient } from 'bambu-link'

export async function main() {

Expand Down
7 changes: 3 additions & 4 deletions bambu-node/package.json → bambu-link/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"name": "bambu-node",
"name": "bambu-link",
"version": "0.1.0",
"description": "",
"description": "A nodejs library for interfacing with the Bambu lab 3D printer",
"main": "dist/index.js",
"scripts": {
"build": "tsup",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"bambujs",
"bambu",
"bambulab",
"p1s",
Expand All @@ -20,7 +19,7 @@
],
"repository": {
"type": "git",
"url": "https://github.com/Evan-2007/bambu-node"
"url": "https://github.com/Evan-2007/bambu-link"
},
"author": "Evan Cooper",
"license": "MIT",
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions bambu-node/src/client.ts → bambu-link/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import mqqt from 'mqtt'
import { actions, ActionsType } from './actions'
import { BambuClientType } from './types'

function bambuClient({hostname, port = 8883, token, serial}: {hostname: string, port?: number, token: string, serial: string}) {
function connect({hostname, port = 8883, token, serial}: {hostname: string, port?: number, token: string, serial: string}) {
const mqqtClient = mqqt.connect(`mqtts://${hostname}:${port}`, {
username: "bblp",
password: token,
Expand Down Expand Up @@ -41,5 +41,5 @@ function bambuClient({hostname, port = 8883, token, serial}: {hostname: string,
}
}

export {bambuClient}
export {connect}

1 change: 1 addition & 0 deletions bambu-link/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { connect } from './client'
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion bambu-node/src/index.ts

This file was deleted.

4 changes: 2 additions & 2 deletions example/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { bambuClient } from 'bambu-node'
import { connect } from 'bambu-link'

export async function main() {

const token = '12345678' //This is a placeholder token. token is found in the printer network settings
const serial = '01P00A000000000' //This is a placeholder serial number. serial is found in the printer settings
const hostname = '192.168.0.1' //Ip address of the printer. Ip addresses can change so it is recommended to set a static ip address for the printer

const client = bambuClient({
const client = connect({
hostname, //Ip address of the printer. Ip addresses can change so it is recommended to set a static ip address for the printer
token,
serial,
Expand Down

0 comments on commit 9a75ada

Please sign in to comment.