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

@phoenix-plugin-registry/pflynn.eval-in-browser

v1.0.2

Published

Run arbitrary snippets of JS code in your browser with one keystroke: while in Live Preview, just select some code and press Ctrl+Shift+J (Cmd+Shift+J on Mac).

Downloads

1

Readme

"Eval in Browser" for Brackets

Run arbitrary snippets of JS code in your browser with one keystroke:

  1. Launch 'Live Preview' to open your page in Chrome
  2. Select some JS code
  3. Press Ctrl+Shift+J

The code is evaluated as if you'd just typed it into the Developer Tools console. This is often not the same result as if you save the code and refresh your web page. For example:

  • Doesn't update the body of existing functions. E.g. running Eval in Browser on an edited method body will not change what happens next time the method is called; it's the same as copy-pasting the method body into the console. However, you can overwrite an entire function in the global namespace, and you can eval extra code to explicitly remove & replace event listeners that were using the original copy of the function.
  • Doesn't change the result of code that's already been run. E.g. changing a global variable that's read by a constructor doesn't affect any existing instances of that object. However, re-executing a protype assignment (e.g. MyClass.prototype.foo = 42;) works well.
  • Aways runs in global scope, so vars next to the selected code aren't accessible (unless the selection is also in the global scope). Variables and functions inside a module or otherwise nested inside a wrapper function aren't accessible unless they've been exported to the global scope.

But when used judiciously, this is a great way to quickly debug or tweak the state of your page without doing a full refresh and losing the page's current state.

How to Install

Eval in Browser is an extension for Brackets, a new open-source code editor for the web.

To install extensions:

  1. Choose File > Extension Manager and select the Available tab
  2. Search for this extension
  3. Click Install!

License

MIT-licensed -- see main.js for details.

Compatibility

Brackets Sprint 33 or newer.