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

ashra-log

v0.0.7

Published

Ashra Log can capture all your console output such as [info, log, error, warn] and HTTP request information that you can use later as your uses.

Downloads

11

Readme

Ashra-Log - Capture Your Console

Ashra Log can capture all your console output such as [info, log, error, warn]and etc and HTTP request information that you can use later as your uses. In a line, we can say, (Read Console With & Get Console).

Why Ashra-log?

  • ashra-log: is a platform independence npm package you can use for all applications.
  • ashra-log: can work with also browser extension development content script
  • ashra-log: It's really lightweight and simple npm package
  • ashra-log: is accepting your ISSUE & PR on GitHub since its fully free.

So, why you are waiting? Just visite our Github Repository and make a star as a appreciate.

Installing

If you are using npm package manager then you can use this command

npm install ashra-log

If you are using yarn package manager then you can use this command

yarn add ashra-log

If you are using pnpm package manager then you can use this command

pnpm add ashra-log

Uses Of ashra-log

console.log("Hello World!"); // write console log as normal

To get your all console log in a array

  • Simple Nodejs/Vanilla JS uses
import { getLogMessages } from "ashra-log"; // es6 - module
const { getLogMessage } = require("ashra-log"); // es5 - commonJS

console.log(getLogMessage(false)); // you can pass skip_last as params - which is boolean
  • React/Nextjs Uses

Before use ashra-log you have to must make it's clinet components

// src/App.tsx
"use client";
import { useEffect, useState } from "react";
import { getLogMessages } from "ashra-log";

const LogViewer = () => {
  const [logs, setLogs] = useState<any[]>([]);
  useEffect(() => {
    fetch(
      `https://jsonplaceholder.typicode.com/posts/${Math.floor(
        Math.random() * 100
      )}`
    )
      .then((respnose) => respnose.json())
      .then((data) => console.log(data))
      .catch((error) => console.log(error));
  }, []);

  const handleClick = () => {
    const logs = getLogMessages(false);
    setLogs(logs);
    alert(JSON.stringify(logs, null, 2)); // Display logs as an alert (you can customize this as needed)
  };

  return (
    <div>
      <button onClick={handleClick}>Click Me</button>
      <div>
        {logs.map((log, index) => (
          <div key={index}>
            <strong>{log.type.toUpperCase()}</strong>
          </div>
        ))}
      </div>
    </div>
  );
};

export default LogViewer;