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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@effect-line/cli

v0.1.0

Published

CLI for Effect Line

Downloads

62

Readme

@effect-line/cli

Command line interface for LINE Platform operations, built with Effect.

Features

  • Type-safe LINE API operations
  • Automatic error handling and retries
  • Environment configuration validation
  • Modern ES modules support

Installation

# Local installation
pnpm add @effect-line/cli

# Global installation
pnpm add -g @effect-line/cli

Configuration

The CLI requires the following environment variables to be set:

export LINE_CHANNEL_ID="your_channel_id"
export LINE_CHANNEL_SECRET="your_channel_secret"
export LINE_CHANNEL_ACCESS_TOKEN="your_channel_access_token"

You can also create a .env file in your project root:

LINE_CHANNEL_ID=your_channel_id
LINE_CHANNEL_SECRET=your_channel_secret
LINE_CHANNEL_ACCESS_TOKEN=your_channel_access_token

Usage

Commands

# Show help
effect-line --help

# Send a message to a single user
effect-line messaging-api push-message --user-id USER_ID --message "Hello, world!" --message "Second message"

# Send messages to multiple users
effect-line messaging-api multicast --user-ids "USER_ID1,USER_ID2" --message "Hello, everyone!"

Command options:

  • push-message

    • -u, --user-id: The user ID to send the message to
    • -m, --message: The message(s) to send (can be specified multiple times)
  • multicast

    • -U, --user-ids: Comma-separated list of user IDs
    • -m, --message: The message(s) to send (can be specified multiple times)

Programmatic Usage

You can also use the CLI programmatically in your Node.js applications:

import { cli } from "@effect-line/cli"
import { NodeContext, NodeRuntime } from "@effect/platform-node"
import { Effect, Layer } from "effect"
import { MessagingApi } from "@effect-line/messaging-api"

// Create the layer
const MainLive = MessagingApi.Default.pipe(
  Layer.merge(NodeContext.layer)
)

// Run the program
const program = cli(process.argv).pipe(
  Effect.provide(MainLive)
)

NodeRuntime.runMain(program)

Development

# Install dependencies
pnpm install

# Build
pnpm build

# Run tests
pnpm test

License

MIT License - see the LICENSE file for details