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 🙏

© 2025 – Pkg Stats / Ryan Hefner

step-fmw

v2.1.0

Published

MVC Framework written in TypeScript for modern single-page applications

Readme

$tep Framework

Model-View-Controller framework in TypeScript/Vanilla JS for Single Page Applications

Version License TypeScript

🎯 Panoramica

$tep è un framework MVC leggero e modulare per costruire Single Page Applications senza dipendenze esterne. Fornisce pattern predefiniti per gestire le interazioni utente più comuni (liste, dettagli, wizard) con un sistema di routing robusto e data binding reattivo.

Cosa rende $tep speciale?

  • Zero dipendenze - Completamente vanilla, nessun vendor lock-in
  • TypeScript-first - Type safety e autocomplete eccezionale
  • Pattern predefiniti - Lista, Dettaglio, Wizard, Lookup pronti all'uso
  • Data binding reattivo - Observable pattern integrato
  • Routing SPA - History API con stack management
  • PWA-ready - Pattern Memento per stato persistente
  • Sicuro - Protezione XSS integrata
  • Performante - Debouncing, throttling, gestione memoria

📦 Installazione

# Installa dipendenze
npm install

# Build TypeScript
npm run build

# Development con watch mode
npm run build:watch

🏗️ Architettura

Il framework implementa un pattern MVC per SPA con tre layer principali:

  • Model: Observable/Computed per data binding reattivo
  • View: Template HTML con binding dichiarativo
  • Controller: Step classes che orchestrano logica e navigazione

📚 Pattern Disponibili

Core Patterns

| Pattern | Descrizione | Use Case | |---------|-------------|----------| | DetailStep | CRUD singola entità | Form inserimento/modifica | | CollectionStep | Liste con ricerca | Tabelle, elenchi | | WizardStep | Multi-fase progressivo | Checkout, onboarding | | LookupStep | Selezione da dizionario | Autocomplete, picker |

🆕 Advanced Patterns (New!)

| Pattern | Descrizione | Use Case | File | |---------|-------------|----------|------| | TreeStep 🗂️ | Strutture gerarchiche con drag & drop | Organigrammi, categorie, menu | AbstractTreeStep.ts | | ImportStep 📥 | Import massivo con validazione (wizard) | Import Excel/CSV, migrazione dati | AbstractImportStep.ts | | ApprovalStep ✅ | Workflow approvazioni multi-livello | Ordini, note spese, documenti | AbstractApprovalStep.ts |

📖 Vedi esempi completi in /examples

🔗 Data Binding

import Observable from './data-binding/Observable.js';

const nome = new Observable('Mario');

// Subscribe a cambiamenti
nome.subscribe(value => console.log('Cambiato:', value));

// Binding con input HTML
nome.bindToHtmlElement(inputElement, validator);

⚙️ Configurazione

import Config from './config/Config.js';

Config.init({
    apiBaseUrl: 'https://api.example.com',
    debug: true,
    logLevel: 'info'
});

🔒 Sicurezza (v2.0.0)

Criticità Risolte

  • XSS Protection: Sanitizzazione HTML automatica
  • Memory Leaks: Cleanup automatico Observable
  • Back Button: Gestione corretta della history
  • Error Handling: Sistema centralizzato con retry
  • Performance: Debouncing input, stack limitati

Protezione XSS

import HtmlSanitizer from './utils/HtmlSanitizer.js';

// Escape automatico
const safe = HtmlSanitizer.escapeHtml(userInput);

// Nelle CollectionStep
setCollection(data) {
    this.collection = this.sanitizeForXss(data);
}

📝 Changelog v2.0.0

Nuove Features

  • ✨ Migrazione TypeScript completa (100%)
  • ✨ Sistema configurazione centralizzata
  • ✨ HtmlSanitizer per protezione XSS
  • ✨ ErrorHandler con retry automatico
  • ✨ Debouncing/throttling utilities
  • TreeStep - Alberi gerarchici con drag & drop
  • ImportStep - Import massivo dati con validazione
  • ApprovalStep - Workflow approvazioni multi-livello
  • ✨ Esempi completi in /examples

Bug Fix

  • 🐛 Fix back button behavior
  • 🐛 Fix memory leak in Observable
  • 🐛 Fix hasOwnProperty pattern
  • 🐛 Stack memento limitato (max 50)

Miglioramenti

  • 📈 Debouncing su input validation
  • 📈 Fetch con timeout e retry
  • 📈 Gestione errori migliorata
  • 📈 Documentazione completa

🛠️ Build e Deploy

# Development
npm run build:watch

# Production
npm run build

# Type check
npm run type-check

# Test
npm test

📄 License

MIT License

👤 Autore

Salvatore Milazzo


Made with ❤️ in Italy