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

ice-storage

v0.3.1

Published

My awesome typescript library

Readme

Homepage: icedigital.pe
Desarrollado por: iCe-Digital

Instalación

  npm install ice-storage

Guía rápida de uso

Almacenamiento cifrado

Próximamente

Autenticación

Próximamente

Preferencias

Próximamente

Firebase Gateway

Para usar las funciones de Firebase, asegúrate de tener Firebase instalado:

  npm install firebase

Inicialización

import IceStorage from 'ice-storage'

// Modo smart por defecto (usa caché automáticamente)
const db = IceStorage.init()

⚠️ Estructura de respuesta

Todos los métodos devuelven documentos con estructura { id, data }

// Ejemplo de respuesta
{
  id: "documentId",
  data: { name: "Juan", age: 25 }
}

Operaciones CRUD

// Crear documento
const result = await db.firestore.create('users', { name: 'Juan', age: 25 })
console.log(result.id)        // ID del documento
console.log(result.data.name) // "Juan"

// También puedes especificar el ID
await db.firestore.create('users', { name: 'Ana' }, 'user-123')

// Leer documento
const user = await db.firestore.read('users', 'userId')
console.log(user.data.name)  // Acceder a los datos

// Actualizar
await db.firestore.update('users', 'userId', { age: 26 })

// Eliminar
await db.firestore.delete('users', 'userId')

Operaciones Atómicas

// Incrementar/decrementar contadores atómicamente
await db.firestore.increment('users', 'userId', 'credits', 10)
await db.firestore.increment('users', 'userId', 'loginCount', 1)

Consultas

// Consulta simple - devuelve array de { id, data }
const allUsers = await db.firestore.query('users')
allUsers.forEach(doc => console.log(doc.id, doc.data))

// Consulta con filtros
const users = await db.firestore.query('users', [
  { type: 'where', field: 'age', operator: '>=', value: 18 },
  { type: 'orderBy', field: 'name', direction: 'asc' },
  { type: 'limit', value: 10 }
])

Suscripciones en tiempo real

// Suscripción a documento individual
const unsubscribe = db.firestore.subscribe('users', 'userId', (doc, error) => {
  if (error) {
    console.error('Error:', error)
    return
  }
  console.log('Usuario actualizado:', doc.data)
})

// Suscripción a colección completa
const unsubscribeCollection = db.firestore.subscribe('users', null, (documents, error) => {
  if (error) {
    console.error('Error:', error)
    return
  }
  // documents es array de { id, data }
  documents.forEach(doc => console.log(doc.id, doc.data))
})

// Suscripción a colección con filtros
const unsubscribeQuery = db.firestore.subscribe('users', 
  [
    { type: 'where', field: 'active', operator: '==', value: true },
    { type: 'orderBy', field: 'createdAt', direction: 'desc' }
  ],
  (documents, error) => {
    documents.forEach(doc => console.log(doc.id, doc.data))
  }
)

// Para cancelar la suscripción
unsubscribe()

Operaciones Batch

// Batch con IDs autogenerados - omite documentId
await db.firestore.batch([
  { type: 'set', collection: 'users', data: { name: 'Ana', age: 25 } },
  { type: 'set', collection: 'users', data: { name: 'Luis', age: 30 } }
])

// Batch con IDs personalizados
await db.firestore.batch([
  { type: 'set', collection: 'users', documentId: 'user1', data: { name: 'Ana' } },
  { type: 'update', collection: 'users', documentId: 'user2', data: { age: 30 } },
  { type: 'delete', collection: 'users', documentId: 'user3' }
])

Modo offline/online

// Forzar modo offline
await db.firestore.goOffline()

// Volver al modo online
await db.firestore.goOnline()

Estado de conexión

// Ver si hay internet
db.firestore.onConnectionChange((state) => {
  console.log('Online:', state.online)
})

Características

  • Estructura consistente: Todos los métodos devuelven { id, data }
  • Modo Smart por defecto: Usa automáticamente el caché de Firestore para optimizar consultas
  • Offline-first: Funciona sin conexión y sincroniza cuando hay internet
  • Timestamps automáticos: Agrega createdAt y updatedAt automáticamente
  • Codificación especial: Maneja Dates, Maps y Sets nativamente
  • Suscripciones unificadas: API simple para documentos y colecciones
  • Persistencia local: Mantiene los datos disponibles sin conexión
  • Sincronización automática: Los cambios se sincronizan cuando vuelve la conexión

Estado global

Próximamente

Backup y restauración

Próximamente

Licencia

MIT