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

symfony-var-dumper-browser

v1.0.1

Published

<small>It is assumed that in the root of your project there is a file `package.json`.</small>

Downloads

55

Readme

This package can be easily used in your Symfony projects.

It allows you to debug through Symfony VarDumper server (bin/console dump:server), providing a convenient and beautiful information output in the browser and without reloading the page.

Thus, you use the dump() function in your code, anywhere, for example, when do you request to REST API, or in the console command and all the information will be displayed in your browser in live mode.

Features:

  • the display is nicely tuned through CSS, the animation of a new messages
  • you can open / close levels (Ctrl + Left Click opens all lower levels)
  • output time in current time zone format and locale (If you are an Arab, then the date will be of this kind: "٢٠‏/١٢‏/٢٠١٢")
  • search by individual messages with convenient display
  • clearing the page from messages
  • you can select the background color (the selection is saved)
  • you can change the width of the container (the selection is saved)

I can add a lot more, write sentences!

Installation

It is assumed that in the root of your project there is a file package.json.

npm install --save-dev symfony-var-dumper-browser
# Or if you're using Yarn
yarn add --dev symfony-var-dumper-browser

Using

You need to start two servers (server:dump and server of this package), fortunately this can be done with one command:

npx dump-browser --run-dump
# Or if you're using Yarn
yarn dump-browser --run-dump

There is a second way:

You can run the server:dump manually:

php ./bin/console server:dump --format=html > dump.html

and then simply run the package without the --run-dump argument.

--help

The following options are available:

Options:
  -v, --version      output the version number
      --host [host]  server host (default: "127.0.0.1")
  -p, --port [port]  server port (default: 9000)
  -b, --path [path]  path to file generated by Symfony's "server:dump" command.
(default: "dump.html")
  -r, --run-dump     manually runs Symfony's "server:dump" command (uses dump.ht
ml).
  --no-open          it won't open your browser.
  -h, --help         output usage information

How it works

Command dump-browser --run-dump starts the Symfony VarDumper server (bin/console dump:server), and another server on the Node.js which you can open in the browser, this package (CLI process) is watching the file changes (dump.html) which makes a symphony server. When the html file is changed through the symphony (and added new messages to this file), a signal is sent to the browser through sockets and the browser displays these messages on the page.

TODO

  • tests
  • checkbox indicating whether the information is initially open (I'm talking about where you can manually open / close it.)
  • icon for the page
  • different output style
  • time in the style of "5 seconds ago", "2 minutes ago"