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

stupefy

v2.0.8

Published

A language independent tool for rapid prototyping stuff.

Downloads

6

Readme

stupefy

Stupefy is a tool for rapid prototyping of scripts/sites/apps etc.

Installation

$ npm install -g stupefy

Go ahead and create / install some spells now (see below).

NOTE: To install and update spells, git is required

How it works

asciicast

Stupefy enchants(modifies) your code with spells, i.e. just a fancy name for a couple of Handlebars templates which expand as snippets on steroids.

Spells are called using a specific syntax within your code comments i.e. -

 enchant <spell name>, key1: value1, key2: [ a1, a2 ] */

where spell name is the file name of the spell.

For example,

function print() {
    s = '';
    /* enchant readFile, file: 'hello.txt', str: 's'  */
    console.log(s);
}

This can be enchanted using:

$ stupefy enchant <filename> # optional: -o <outputfile>

Spells are present in spellbooks, which are mere git repositories comprising such Handlebars templates. Adding the templates to t One such being this.

The spellbook can be installed using

$ stupefy install https://github.com/thelehhman/spellbook

Spellbooks can be updated anytime using the command

$ stupefy update

More Demos

One spell can be enchanted in many languages so that you focus on the application and not the syntax.

For example, here is a demo using the spell sieve in both C++ and Python

asciicast asciicast

Variables

Global variables can be defined using def global. In an HTML File, for example,

<!-- def global, list: [ 1, 2, 3] -->

Configuration

The file ~/.stupefy.json can be configured to manipulate -

  • The default opening and closing tag using : tag_start, tag_end,
  • The spellbooks directory, using: spells
  • Disabling language based opening and closing tags by setting : auto_tags
  • Custom plugins using plugins array

Stupefy v/s Snippets

  • Language Independent (i.e. same spell can do same stuff across different languages)

    For example, the shell_exec spell allows you to forget about the standard library and emphasize the idea on different programming languages.

  • Support Objects and Arrays as arguments to build up dynamic code (see bootstrap_nav)

  • Code Editor Independent

  • Spells are easier to manage than snippets