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 πŸ™

Β© 2026 – Pkg Stats / Ryan Hefner

@hikyu/soap

v1.3.3

Published

Your new server πŸ’Ύ Simple, quick and light 🀏

Downloads

95

Readme

Soap 🧼

Your new server πŸ’Ύ Simple, quick and light 🀏

Install πŸ—ƒ

You may have to install a view engine of your choice too πŸ“Œ

npm i @hikyu/soap

Usage

I will use the simple 🐣 require for demonstration

const soap =  require('@hikyu/soap');

// Run once if the server is started
soap.once('started', (data) => {
	console.log(`Server running on port ${data.port} (Listener)`);
});

// Start the server on port 3000 βš™
soap.init(3000);

Content

Routes

soap.get('path', callback);

soap.post('path', callback);

Smart-Routing

Automatically renders pages from the views folder. Depends on the requested path Example

// Enable smartRouting and set options
soap.smartRouting({
    // enabled: true,
    viewEngine: 'pug',
    defaultPage: 'landing' // localhost/ => ./views/landing.pug
});

// localhost/        => ./views/landing.pug
// localhost/page    => ./views/page.pug
// localhost/tasks/1 => ./views/tasks/1.pug

Render

It's pretty simple to use view engines πŸ‘€ in Soap 🧼 Just add the extention to the path and render it! Avaiable view engines:

  • HTML
  • EJS
  • Pug
soap.get('/', (req, res) => {
	// HTML
	res.render('index.html');

	// EJS
	res.render('index.ejs', { siteName: "Soap 🧼" });

	// Pug
	res.render('index.pug', { siteName: "Soap 🧼" });
});

Send

Just want to show simple text πŸ“ƒ? So use send

soap.get('/', (req, res) => {
	res.send('Hey there, this is sent via Soap 🧼!');
});

JSON

Same with send there's JSON rendering aswell πŸ”‘

soap.get('/', (req, res) => {
	res.json([
		{ name: "Dog", emoji: "πŸ•" },
		{ name: "Cat", emoji: "🐈" },
		{ name: "Llama", emoji: "πŸ¦™" }
	]);
});

Parameters

Query

// Get query parameters is simple:
soap.get('/', (req, res) => {
	const query = req.query;
	res.send(`Your query: ${query}`);
});

Body

// For the body of post:
soap.post('/', async (req, res) => {
	// It's required to wait a bit
	const post = await req.post;
	res.send(`Your post body: ${post}`);
});

Folders

Views

Every file that will be rendered, should be in the ./views folder.

Public

Files that have to be user-reachable, should be in the ./public folder.

Events

// Run once if the server has started
soap.once('started', (data) => {
	console.log(`Server running on port ${data.port} (Listener)`);
});

// Run every time when a client requests a route
soap.on('request', (data) => {
	console.log(`Client requests on path ${data.path} (Listener)`);
});

// Run every time a file is sent to the client
soap.on('load', (data) => {
	console.log(`File ${data.path} loaded (Listener)`);
});

// Run every time a file is rendered
soap.on('render', (data) => {
	console.log(`File ${data.file} rendered on path ${data.path} (Listener)`);
});

// Run every time, json is sent
soap.on('json', (data) => {
	console.log(`Sent json data from ${data.path} (Listener)`);
});

// Run every time, pain text is sent
soap.on('send', (data) => {
	console.log(`Sent plaint text from ${data.path} (Listener)`);
});

// Run every time a path is not found
soap.on('404', (data) => {
	console.log(`Path ${data.path} not found (Listener)`);
});

// GET
soap.on('get', (data) => {
	console.log(`GET ${data.path}`);
});

// POST
soap.on('post', (data) => {
	console.log(`POST ${data.path}`);
});