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 🙏

© 2025 – Pkg Stats / Ryan Hefner

get-codeshare

v0.1.3

Published

A CLI to instantly share links to specific lines of code.

Downloads

18

Readme

CodeShare CLI

Instantly share code from your terminal. The missing link for your code.

npm version

This is the official command-line interface for the CodeShare suite. It allows you to generate universal, shareable links to specific lines of code directly from your terminal, without ever leaving your workflow.

The generated links are smart: they open in VS Code for teammates who have the CodeShare extension and fall back to a beautiful, read-only web view for everyone else.

Features

  • Blazing Fast: Create links to code selections in seconds.
  • Git-Aware: Automatically detects your Git repository, branch, and remote to create permanent, context-rich links.
  • Stateless Fallback: Works even outside of a Git repository by creating temporary, shareable snippet links.
  • Cross-Platform: Works on macOS, Windows (WSL, Git Bash), and Linux.
  • Clipboard Integration: Automatically copies the generated link to your clipboard.

Installation

To install the CodeShare CLI, you need to have Node.js and npm installed.

Install the package globally using npm:

npm install -g get-codeshare

This will make the codeshare command available in your system's PATH.

Usage

The command's syntax is simple:

codeshare path/to/your/file.js:line

Examples

1. Sharing a Single Line

This command will generate a link to line 42 of src/server.ts.

codeshare src/server.ts:42

2. Sharing a Range of Lines

To share a range of lines (e.g., from line 10 to 25), use a hyphen.

codeshare src/app.js:10-25

How It Works: Two Powerful Modes

The CodeShare CLI automatically adapts to your context.

Mode 1: Git-Aware Link (In a Git Repository)

If the file you're sharing is part of a Git repository with a remote origin or upstream, the CLI will generate a permanent, context-aware link.

Example Output (Git-Aware):

✅ Link (Git-aware) copied to clipboard!
https://codeshare.sarthaks.tech/l/aHR0.../bWFpbg==/c3JjL2FwcC5qcw==/10-25

This link contains the encoded Git remote URL, branch name, file path, and line range.

Mode 2: Stateless Snippet Link (Outside a Git Repository)

If you use the CLI on a file that isn't tracked by Git, or in a directory that isn't a Git repository, it will automatically create a temporary snippet link.

Example Output (Stateless Snippet):

Not a Git repository. Creating a shareable snippet link...
✅ Snippet link copied to clipboard!
https://codeshare.sarthaks.tech/s/yCw8_SoC

This link points to a temporary, anonymous snippet that will expire after 24 hours.

Contributing

This project is open source and part of the CodeShare suite. Contributions are welcome! Please feel free to open an issue or submit a pull request on the main CodeShare Project Repository.

License

This project is licensed under the MIT License.