
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Lazer is a utility for printing to the console using a fluent API. Written in TypeScript and compatible with Deno and Node.js runtimes.
Lazer helps you build, format and print complex messages to the console using an expressive fluent API.
example.ts
import { lazer } from "https://deno.land/x/lazer/mod.ts"
lazer()
.print("Hello,")
.print_space()
.print_green("Green World")
.print_ln("!")
$ deno run example.ts
Hello, Green World!
example.ts
import { lazer } from "https://deno.land/x/lazer/mod.ts"
const remoteAddr = "127.0.0.1";
const method = "GET";
const path = "/a/really/really/really/long/path/here";
const status = 200;
const time_ms = 20;
const size_bytes_string = "1.10kB";
lazer()
.print('[').print_utc_time().print(']')
.print_space().print("-").print_space()
.print_pad_right(remoteAddr, 15, '_')
.print_space(2)
.print_pad_right(method, 4, '_')
.print_space(2)
.print_pad_right(path, 20, "_")
.print_space(2)
.if(status >= 200 && status < 300)
.print_green(status)
.elseif(status >= 300 && status < 400)
.print_yellow(status)
.elseif(status >= 400)
.print_red(status)
.end()
.print_space(2)
.print_pad_right(`${time_ms}ms`, 6, "_")
.print_space(2)
.print_ln(size_bytes_string);
$ deno run example.ts
[Fri, 01 Jan 2021 00:00:00 GMT] - 127.0.0.1______ GET_ /a/really/really/+42 200 20ms__ 1.10kB
example.ts
import { lazer } from "https://deno.land/x/lazer/mod.ts"
const getLinePrefix = () =>
{
return lazer().buffer()
.print_yellow('[').print_yellow("Line Prefix").print_yellow(']')
.print_space().print("-").print_space()
.print_yellow('[').set_color_yellow().print_utc_time().print_yellow(']')
.print_space().print("-").print_space()
.return();
}
lazer()
.print(getLinePrefix())
.print_yellow_ln("This is a prefixed line of text output");
lazer()
.print(getLinePrefix())
.print_yellow_ln("This is another prefixed line of text output");
$ deno run example.ts
[Line Prefix] - [Mon, 10 May 2021 16:31:29 GMT] - This is a prefixed line of text output
[Line Prefix] - [Mon, 10 May 2021 16:31:29 GMT] - This is another prefixed line of text output
example.ts
import { lazer } from "https://deno.land/x/lazer/mod.ts"
lazer().buffer()
.set_color_red().print_ln("Some red output to buffer")
.store('i am an alias');
lazer().buffer()
.load('i am an alias')
.print_b();
$ deno run example.ts
Some red output to buffer
example.ts
import { lazer } from "https://deno.land/x/lazer/mod.ts"
lazer()
.color_off()
.print_yellow_ln("I am not yellow")
.color_on()
.print_yellow_ln("I am yellow");
$ deno run example.ts
I am not yellow
I am yellow
import { lazer } from "https://deno.land/x/lazer/mod.ts"
npm i --save lazer-js
const { lazer } = require('lazer-js');
FAQs
A console printer with a fluent API
The npm package lazer-js receives a total of 0 weekly downloads. As such, lazer-js popularity was classified as not popular.
We found that lazer-js 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
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.