
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
annotate-code
Advanced tools
beautifully annotate source code with a message, given an index, like a parser or compiler
beautifully annotate source code with a message, given an index, like a parser or compiler
🔧 Install · 🧩 Example · 📜 API docs · 🔥 Releases · 💪🏼 Contribute · 🖐️ Help
$ npm i annotate-code
import { annotate } from 'annotate-code'
console.log(
annotate({
message: 'some error message',
index: 48,
size: 6,
input,
}).message
)
Annotates a source code string given an index and a message.
settings
{message: string, input: string, index: number, linesBefore: number?, linesAfter: number?, size: number?, showLineNumbers: boolean?}
settings.message
The message to displaysettings.input
The code to annotatesettings.index
The index positionsettings.linesBefore
How many lines before to show (optional, default 3
)settings.linesAfter
How many lines after to show (optional, default 3
)settings.size
The size of the arrows ^^^^ (optional, default 1
)settings.showLineNumbers
Whether to show line numbers (optional, default true
)Returns {line: number?, col: number?, message: string}
All contributions are welcome!
MIT © 2021 stagas
FAQs
beautifully annotate source code with a message, given an index, like a parser or compiler
The npm package annotate-code receives a total of 9 weekly downloads. As such, annotate-code popularity was classified as not popular.
We found that annotate-code demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.