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

@federa/integration

v0.6.10

Published

Integration layer for Federa packages

Downloads

87

Readme

@federa/integration

Capa de integración para los paquetes de Federa.

Descripción

Este paquete proporciona adaptadores para diferentes plataformas sociales y un servicio de federación unificado que permite interactuar con todas ellas a través de una API común.

Compatibilidad con navegador

A partir de la versión 0.1.3, este paquete es compatible tanto con entornos de Node.js como con entornos de navegador. El paquete detecta automáticamente el entorno en el que se está ejecutando y utiliza las implementaciones adecuadas.

Instalación

npm install @federa/integration

Uso

En Node.js o en el navegador

import { BlueskyAdapter, FederationService, isBrowser, isNode } from '@federa/integration';
import { BlueskyClient } from '@federa/bluesky';

// Verificar el entorno
if (isBrowser) {
  console.log('Ejecutando en el navegador');
} else if (isNode) {
  console.log('Ejecutando en Node.js');
}

// Crear un cliente de Bluesky
const client = new BlueskyClient({
  service: 'https://bsky.social',
  // Credenciales o sesión
});

// Crear un adaptador de Bluesky
const adapter = new BlueskyAdapter(client);

// Obtener el timeline
const timeline = await adapter.getTimeline();

El código es el mismo para ambos entornos, ya que el paquete detecta automáticamente el entorno y utiliza las implementaciones adecuadas.

Variables de entorno

El paquete proporciona varias variables para detectar el entorno en el que se está ejecutando:

  • isBrowser: true si se está ejecutando en un navegador, false si se está ejecutando en Node.js
  • isNode: true si se está ejecutando en Node.js, false si se está ejecutando en un navegador
  • isTest: true si se está ejecutando en un entorno de pruebas (NODE_ENV=test)
  • isDevelopment: true si se está ejecutando en un entorno de desarrollo (NODE_ENV=development)
  • isProduction: true si se está ejecutando en un entorno de producción (NODE_ENV=production)

Estas variables pueden ser útiles para condicionar el comportamiento de tu aplicación según el entorno.

Configuración del bundler

Si estás utilizando un bundler como Webpack, Rollup o Vite, es posible que necesites configurarlo para proporcionar implementaciones alternativas de los módulos de Node.js. Este paquete ya incluye una configuración de Webpack que puedes utilizar como referencia.

Webpack

// webpack.config.js
module.exports = {
  // ...
  resolve: {
    fallback: {
      "fs": false,
      "path": require.resolve("path-browserify"),
      // Otros módulos de Node.js que necesites
    }
  },
  plugins: [
    new webpack.ProvidePlugin({
      Buffer: ['buffer', 'Buffer'],
      process: 'process/browser',
    }),
  ],
};

Vite

// vite.config.js
import { defineConfig } from 'vite';

export default defineConfig({
  // ...
  resolve: {
    alias: {
      'node:fs': 'browserify-fs',
      // Otros módulos de Node.js que necesites
    }
  },
  define: {
    'process.env': {},
    'global': 'window',
  },
});

Licencia

AGPL-3.0