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

fastfront

v2.0.2

Published

Lightweight utility package with 30+ functions for storage, files, dates, and strings - essential utilities for web development

Readme

FastFront

A lightweight utility package with storage, file, date, and string utilities for modern web applications.

🚀 Features

  • Storage: localStorage, sessionStorage, and cookie utilities
  • Files: File handling, MIME types, and path utilities
  • Dates: Date formatting and time ago calculations
  • Strings: Capitalization and slugification

📦 Installation

npm install fastfront

🔧 Usage

Storage

import { localStorage, sessionStorage, cookies } from 'fastfront';

// Local storage with error handling
localStorage.set('user', { name: 'John', age: 30 });
const user = localStorage.get('user');     // { name: 'John', age: 30 }
localStorage.remove('user');
localStorage.clear();

// Session storage
sessionStorage.set('token', 'abc123');
const token = sessionStorage.get('token'); // 'abc123'

// Cookies
cookies.set('sessionId', 'xyz789', { expires: 7, secure: true });
const sessionId = cookies.get('sessionId'); // 'xyz789'
cookies.remove('sessionId');

Files

import { formatFileSize, getFileExtension, getMimeType, isImage, isVideo, sanitizeFilename } from 'fastfront';

// File information
formatFileSize(1024);                     // '1 KB'
getFileExtension('document.pdf');         // 'pdf'
getMimeType('image.jpg');                 // 'image/jpeg'

// File type checking
isImage('photo.png');                      // true
isVideo('movie.mp4');                      // true
isDocument('report.pdf');                  // true

// File path utilities
getFilename('/path/to/file.txt');         // 'file.txt'
getDirectory('/path/to/file.txt');        // '/path/to'
normalizePath('path//to///file.txt');     // 'path/to/file.txt'
joinPath('path', 'to', 'file.txt');       // 'path/to/file.txt'

// File name utilities
sanitizeFilename('file<>:"/\\|?*.txt');   // 'file_______.txt'
generateUniqueFilename('document.pdf');    // 'document_1234567890_abc123.pdf'

Dates

import { formatDate, timeAgo } from 'fastfront';

// Format dates
formatDate(new Date());                    // "22 Aug 2025"
formatDate('2025-08-22');                 // "22 Aug 2025"
formatDate(new Date(), 'YYYY-MM-DD');     // "2025-Aug-22"

// Time ago
timeAgo(new Date('2025-08-22T11:55:00Z')); // "5 minutes ago"
timeAgo('2025-08-20T12:00:00Z');           // "2 days ago"

Strings

import { capitalize, slugify } from 'fastfront';

// Capitalize strings
capitalize('prakash');                    // "Prakash"
capitalize('hello world');                // "Hello world"

// Create slugs
slugify('Frontend Utils Package');        // "frontend-utils-package"
slugify('User@123');                      // "user123"

🏗️ Building

npm run build

This creates:

  • dist/index.js - CommonJS bundle
  • dist/index.esm.js - ES Module bundle
  • dist/index.umd.js - UMD bundle
  • dist/index.d.ts - TypeScript declarations

📚 API Reference

Storage

localStorage.set(key, value)

Sets a value in localStorage with error handling.

localStorage.get(key)

Gets a value from localStorage with error handling.

localStorage.remove(key)

Removes a value from localStorage.

localStorage.clear()

Clears all localStorage data.

sessionStorage.set(key, value)

Sets a value in sessionStorage.

sessionStorage.get(key)

Gets a value from sessionStorage.

cookies.set(name, value, options?)

Sets a cookie with options.

cookies.get(name)

Gets a cookie value.

cookies.remove(name)

Removes a cookie.

Files

formatFileSize(bytes)

Formats file size in human-readable format.

getFileExtension(filename)

Extracts file extension from filename.

getMimeType(filename)

Gets MIME type based on file extension.

isImage(filename)

Checks if file is an image.

isVideo(filename)

Checks if file is a video.

sanitizeFilename(filename)

Sanitizes filename for safe storage.

Dates

formatDate(date, format?)

Formats a date according to the specified format.

timeAgo(date)

Gets a human-readable time ago string.

Strings

capitalize(str)

Capitalizes the first letter of a string.

slugify(str)

Converts a string to a URL-friendly slug.

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

📄 License

MIT License - see LICENSE file for details.

🆘 Support

For support and questions, please open an issue on GitHub.