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

@smdv/localization

v1.2.90

Published

<div align="center">

Downloads

115

Readme

@smdv/localization

Librería Angular para localización dinámica, sesión, permisos y auditoría.

✨ Características

  • Carga remota de recursos de idioma (multi-módulo)
  • Manejo de sesión y permisos (guards + interceptor HTTP)
  • Registro de eventos (event log)
  • Tipos e interfaces reutilizables

✅ Requisitos

  • Angular >= 14 (recomendado 16+)
  • HttpClientModule disponible

📦 Instalación

npm install @smdv/localization

⚙️ Configuración del módulo

Usar forRoot para inyectar la configuración (environment de la librería):

import { LocalizationModule } from '@smdv/localization';

@NgModule({
	imports: [
		LocalizationModule.forRoot({
			msLocalizationApiUrl: 'https://api.example.com/localization',
			msConfigurationsApiUrl: 'https://api.example.com/config',
			application: 'my-app'
		})
	]
})
export class AppModule {}

🧪 Uso del servicio de localización

import { LocalizationService } from '@smdv/localization';

constructor(private loc: LocalizationService) {}

ngOnInit() {
	this.loc.loadLocales(['general', 'dashboard']);
	const mensaje = this.loc.getLocalization('welcome');
}

🔐 Sesión y permisos

Guard de activación (ejemplo conceptual):

// SessionCanActiveService protege rutas según sesión válida
{
	path: 'panel',
	canActivate: [SessionCanActiveService],
	loadChildren: () => import('./panel/panel.module').then(m => m.PanelModule)
}

Interceptor HTTP: Se registra automáticamente al importar el módulo (si está configurado en providers en el futuro). Asegúrate de no duplicar interceptores globales.

🧱 Interfaces clave

Ubicadas en services/interfaces/ (posible futura carpeta models/):

  • AuthSession
  • Permits
  • EventLog
  • PaginatedData<T>
  • ResponseApi<T>

🌐 Carga de recursos

El método loadLocales(modulos: string[]) obtiene y cachea recursos por módulo. Luego getLocalization(key: string) retorna el texto asociado.

🛠 Scripts útiles

| Acción | Comando | |--------|---------| | Build | ng build localization | | Tests | ng test localization | | Producción | ng build localization --configuration production | | Publicar | npm publish (desde dist/localization) |

🧬 Publicación

  1. Incrementar versión en projects/localization/package.json (semver).
  2. ng build localization.
  3. cd dist/localization.
  4. npm publish (usar --access public si es necesario / registro privado si aplica).

🧹 Limpieza local

rm -rf node_modules dist .angular
npm ci
ng build localization

🗺 Roadmap sugerido

  • Refactor de enviroment a environment
  • Módulo separado para auditoría si crece
  • Migrar interfaces a models/
  • Añadir tests de integración (módulo + interceptor + guard)

🤝 Contribuir

  1. Rama: feature/nombre
  2. Commits claros
  3. PR con descripción funcional / breaking changes

📄 Licencia

Privado / Interno (definir si se publica públicamente más adelante)


Mantén este README actualizado conforme evolucione la API.