npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

lineclientbot

v0.1.3

Published

LINE client library for Node.js

Readme

lineclientbot

LINE client library for Node.js.

Install

npm install lineclientbot

Quick Start

import { LineClient } from "lineclientbot";

// Login with auth token
const line = new LineClient();
await line.login({ authToken: "YOUR_AUTH_TOKEN" });

// Send a message
await line.sendMessage("u1234567890abcdef1234567890abcdef", "Hello!");

// Listen for messages
line.on("message", async (msg) => {
    console.log(`${msg.from}: ${msg.text}`);
    await msg.reply(`Echo: ${msg.text}`);
});

line.listen();

If you want the library to remember the login automatically, pass rememberMe: true or rememberMe: "./my-token.txt".

API

Constructor

new LineClient(options?)

| Option | Type | Default | Description | |--------|------|---------|-------------| | authToken | string | - | Auth token for direct login | | mail | string | - | Email for login | | pass | string | - | Password for login | | device | Device | "DESKTOPWIN" | Device type to emulate | | version | string | auto | LINE app version | | endpoint | string | "legy.line-apps.com" | API endpoint | | storage | string \| false | false | File path for persistence, or false for memory only | | rememberMe | boolean \| string | false | Remember auth token in a plain text file |

Login

// With auth token
const line = new LineClient();
await line.login({ authToken: "xxx" });

// With email/password
const line2 = new LineClient();
await line2.login({ mail: "[email protected]", pass: "password" });

// QR Login with event callbacks
const qrClient = await LineClient.loginWithQR({
    rememberMe: true,
    onQR: (url) => console.log("Scan:", url),
    onPin: (pin) => console.log("PIN:", pin),
});

// QR Login from an instance
const client = new LineClient();
await client.login({ rememberMe: true });

QR login is the easiest way to get a fresh authToken. When rememberMe is enabled, the library stores the token in a text file and reuses it on later runs.

Profile

const profile = await line.getMyProfile();
await line.updateMyProfile({ displayName: "New Name" });

Messages

// Send text
await line.sendMessage(chatId, "Hello!");

// Other message types (require full integration)
await line.sendImage(chatId, imageBuffer);
await line.sendVideo(chatId, videoBuffer);
await line.sendAudio(chatId, audioBuffer);
await line.sendFile(chatId, fileBuffer, "file.txt");
await line.sendSticker(chatId, "stickerId");
await line.sendFlex(chatId, "Alt text", flexJson);
await line.sendLocation(chatId, {
    title: "Location",
    address: "123 Street",
    latitude: 13.7563,
    longitude: 100.5018,
});

Chat Management

const chats = await line.getChats();
const chat = await line.getChat(chatMid);
const newChat = await line.createChat({ name: "My Group", memberMids: ["mid1", "mid2"] });
await line.inviteToChat(chatMid, ["mid1"]);
await line.leaveChat(chatMid);

Friends

const contacts = await line.getContacts();
const user = await line.getContact(userMid);
await line.blockContact(userMid);
await line.unblockContact(userMid);

OpenChat (Square)

const squares = await line.getSquares();
await line.joinSquare(invitationUrl);
await line.leaveSquare(squareMid);

Events

line.on("message", async (msg) => {
    console.log(msg.text);
    await msg.reply("Got it!");
    await msg.react("👍");
    await msg.read();
});

line.on("event", (event) => {
    console.log("Event:", event.type);
});

line.listen();

Storage

import { LineClient, FileStorage, MemoryStorage } from "lineclientbot";

// File-based storage (persists across restarts)
const lineWithFileStorage = new LineClient({
    authToken: "xxx",
    storage: "./line-data.json",
});

// Memory storage (default, no persistence)
const lineInMemory = new LineClient({
    authToken: "xxx",
    storage: false,
});

Device Types

| Device | Description | |--------|-------------| | "DESKTOPWIN" | Windows desktop (default) | | "DESKTOPMAC" | Mac desktop | | "ANDROID" | Android phone | | "ANDROIDSECONDARY" | Android secondary device | | "IOS" | iPhone | | "IOSIPAD" | iPad | | "WATCHOS" | Apple Watch | | "WEAROS" | Wear OS |

Events

| Event | Callback | Description | |-------|----------|-------------| | message | (msg: MessageEvent) => void | New message received | | event | (event: any) => void | Any LINE event | | square:message | (msg: MessageEvent) => void | OpenChat message | | square:event | (event: any) => void | OpenChat event | | log | (data: {type, data}) => void | Debug logs |

License

MIT