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

chromelog

v1.0.3

Published

Log stuff from anywhere into chrome

Downloads

4

Readme

chromelog - 1.0.3

Because sometimes, all you need is a console.log in chrome.

We follow breaking.feature.fix versioning

This project came out of the frustrations faced when developing on react-native, and trying to "debug in chrome", just because I needed the good old console.log inside chrome so I could explore objects that I want to explore.

(for those who are not aware, react-native's "debug in chrome" gives you the full fledged chrome debugger for react-native, but makes your app crawl, and makes you cry)

Usage:

npm install --save chromelog

And add "chromelog": "chromelog" under the "scripts" key in your project's package.json. It should look something like this:

{
  "name": "AwesomeReactNativeAppOrSomeOtherProject",
  "version": "0.9.0",
  "description": "Log stuff from anywhere into chrome",
  "main": "index.js",
  "scripts": {
    ...
    "chromelog": "chromelog"
  },
  ...
}

Now you can start the chromelog server by running this command from your project root: npm run chromelog

When you run this command, you'll see something like this:

chromelog screenshot

This will show you your chromelog endpoint to for various networks your dev-machine is connected to. Copy the chromelog endpoint you'll need it real soon.

And your browser will open up, which will show you something like this if you open up the console too

browser screenshot

Logging things for react-native

Almost there. In the root of your react-native project, you can see the files index.android.js and index.ios.js. These are entry points into your app. At the top of these files, where all the imports and requires are, add one of the following for chromelog.

const chromelog = require('chromelog') // OR
import chromelog from 'chromelog'

At the bottom, you will see something like this:

AppRegistry.registerComponent('FormApp', () => FormApp);

Just before it, set the chromelog endpoint that you previously copied. Like this:

chromelog.endpoint = 'http://192.168.43.218:1989';

AppRegistry.registerComponent('FormApp', () => FormApp);

Now just use chromelog wherever you want in your project, and you can see console.log in chrome without react-native's "debug in chrome" . Example

const chromelog = require('chromelog') // OR
import chromelog from 'chromelog'

class Foo extends Component {
  ...
  componentWillMount() {
    chromelog(this.props.user);
  }
  ...
}

Here's a screenshot

chromelog demo

  • You can also install chromelog globally, but you do need to install it in the project where you plan to use it, so just skip the global install I'd say. With node, never install anything globally.

  • Full chromelog script arguments below

{
  "scripts": {
    ...
    "chromelog": "chromelog <port> <host>"
  },
}