
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Achorn
is a colorful, good-looking, fully customizable logging utility for the Browser. It is heavily inspired by @klaussinanis Signale logger for Node.js backend applications.
![]() | ![]() | ![]() | ![]() | ![]() |
---|---|---|---|---|
Latest ✔ | Latest ✔ | 10+ ✔ | Latest ✔ | 6.1+ ✔ |
# NPM
npm install achorn
# Yarn
yarn add achorn
Don't forget to import Achorn!
import Achorn from "achorn";
<!-- unpkg -->
<script src="https://unpkg.com/achorn/lib/achorn.js"></script>
<!-- jsdelivr -->
<script src="https://cdn.jsdelivr.net/npm/achorn/lib/achorn.js"></script>
The first thing after importing Achorn is creating a new Achorn()
instance:
// Without config
const achorn = new Achorn();
// With custom config
const achorn = new Achorn({
showTimestamp: true,
globalPrefix: [...]
});
Achorn takes an optional Config object as input. For all config options, see the config interface file.
After the initial setup, you can already use any of Achorns default loggers, which are defined in their dedicated prefixes file. Optionally, you can add your own prefixes/loggers by providing them in the prefixes
field in the Config.
The most common use for Timers in Achorn are probably HTTP requests. Here's an example implementation:
// Create timer with custom name (optional)
const timer = achorn.timer("Async");
request("https://google.com")
.then((res) => {
timer.success("Request successful! 🎉");
achorn.info("Result:", res);
})
.catch((err) => {
timer.error("Request failed.");
achorn.error(err);
});
Which will then produce this console output:
FAQs
🌰 A colourful, good looking, fully customisable logger for the browser
The npm package achorn receives a total of 1 weekly downloads. As such, achorn popularity was classified as not popular.
We found that achorn demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.