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

inline-math

v0.0.11

Published

Evaluate math expressions right in your editor

Downloads

4

Readme

Inline Math for VS Code provides instant math evaluation, anywhere you type! Incredibly useful for quick arithmetic, trigonometry, even unit conversion!

Inline Math follows your cursor and tries to find a valid math expression within the current line. If you highlight some text, it looks within the selection (and works accross multiple lines, too!)

The inlay message can be configured with a custom template, and the hover message can be toggled on/off

Commands

| Command | Description | | ------------------ | ----------------------------------------------------- | | Toggle Inline Math | Disable/Enable inline math | | Copy Math Result | Copy the currently shown evaluations to the clipboard |

Settings

| Setting | Default | Description | | ----------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | | enabled | true | Enables the extension | | delay | 500 | Delay, in milliseconds, after cusor stops moving until calculation starts - 0 will be instant but try a higher value if you run into performance issues | | messageTemplate | $source = $result | Template used for all inline messages. Interpolates $source, $result | | messageMaxChars | 30 | Max length of $source replacement in messageTemplate. Result will never be truncated | | hoverMessage | true | Toggle showing the hover message or not | | margin | 2ch | Distance between the end of current line and the start of inline message (Supports CSS sizes like ch) | | padding | 2px 1ch | Inner padding of the inline message | | borderRadius | 5px | Border radius of the inline message | | fontFamily | '' | Font family of inline message | | fontSize | 0.85em | Font size of inline message | | fontWeight | normal | Font weight of inline message | | fontStyleItalic | true | Makes inline message italic |

Colors

| Color | Default | Description | | ---------------------------- | ----------- | --------------------------------------- | | inlineMath.background | #00b7e420 | Background color | | inlineMath.backgroundLight | #00b7e420 | Background color (Only in light themes) | | inlineMath.foreground | #00b7e4 | Text color | | inlineMath.foregroundLight | #00b7e4 | Text color (Only in light themes) |

Technical details

Inline Math works by searching subsets of your current line, split on every space. This is to limit the complexity of parsing every possible expression within the current line, but allows you to see results that are in the middle of unrelated code. Each subset, from largest to smallest, is parsed by mathjs and if successful, shows a result. Results are cached to prevent unnecessary calculations (although subset results are not cached right now, pending some profiling...).

Acknowledgements

  • Inline Math borrows heavily, in code structure and style, from Error Lens

  • Under the hood, all evaluation is done with mathjs

Other bits

  • Please report any bugs or make suggestions via Github Issues

  • Contributions are welcome and this extension is in active development

  • Released under the MIT License, free to do whatever you like with it