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

@benjy2976/integrador-fp

v1.0.1

Published

herramienta para integracion de aplicaciones a el aplicativo FirmaPeru

Readme

integrador-FP

Integrador de aplicacion FirmaPeru en soluciones Javascript

instalando

usando npm:

npm i @benjy2976/integrador-fp

Ejemplo

//
//la inicializacion de la instancia de axios da la posibilidad de personalizarla, con datos como el token de acceso
let instance = axios.create()

import FirmaPeruIntegrador from '@benjy2976/integrador-fp';
// la ruta para obtener los parametros sera por POST a http://127.0.0.1/parametros/{file_id}'
let url_parametros 'http://127.0.0.1:8000/parametros'
let id_file=null
let firmador = new FirmaPeruIntegrador({
        //la instancia es opcional, de no pasarse el dato la libreria inicializara una nueva instancia
        instance      : instance,//la instancia de axios con la que se accederan a los requests
        maximumTry    : 60,
        idApp         : 'addComponent',//id de la etiqueta HTML en la que trabajara el componente
        vervose       : false,//si se pone true se imprimiran en consola cada paso de la firma, util en desarrollo
        signatureInit : () => {
            console.log('signatureInit')
            //acciones que se vayan a realizar cuando el proceso de la firma inicie
        },
        signatureOk   : () => {
            console.log('signatureOk')
            //acciones que se vayan a realizar cuando el proceso de la firma culmine satisfactoriamente
        },
        signatureCancel : () => {
            console.log('signatureCancel')
            //acciones que se vayan a realizar cuando el proceso de la firma se cancele
        },

        getParams     : () => {
            //metodo a traves del cual se obtendran los parametros de la firma
            let route = baseurl + "firmaperu/firma_token_params/"+id_file;
            let parametros = {
                "param_url"          : route,
                "param_token"        : "1212121212",//este parametro se puede personalizar segun la necesidad
                "document_extension" : "pdf"
            }
            //aqui se realiza el hasheo, tambien se puede usar axios para obtener los parametros hasheados desde el server
            return btoa(JSON.stringify(parametros))
        }
    })

port : default 48596

puerto en el que se iniciara el servicio de FirmaPeru, solo instanciar en caso de personalizar

maximumTry : default 60

variable que define la cantidad maxima de intentos de conexion con el servicio antes de detenerse

getParams : default function(){}

funcion en la que se optienen los parametros de configuracion de FirmaPeru en base64

signatureInit : default function(){}

funcion que se ejecuta cuando se inicia la firma

signatureOk : default function(){}

funcion que se ejecuta cuando la firma termico con exito

signatureCancel : default function(){}

uncion que se ejecuta cuando la firma fue cancelada

idApp : default 'addComponent'

aqui se precisa el id de la etiqueta html que se usara para invocar el aplicativo

vervose : default false

aqui se precisa el nivel de detalle de los logs a mostrarse en la consola

en un archivo index.html se pondria el siguiente contenido el id de la etiqueta tiene que coincidir con la variable idAPP

    ...

    <div id="addComponent" style="display:none;"></div>
    ...

para revisar si es firmador esta en linea se usa el siguiente comando


    firmador.startCheckServer()

encender el firmador


    firmador.runService()

el estado del firmador se accede de la siguiente manera


    console.log(firmador.online)
    //true

cuando el servidor se encuentre en linea se puede iniciar el proceso de firma los parametros de firma se tienen que configurar a traves de la funcion getParams()

//iniciando la firma para el documento con file_id = 5
id_file=5
firmador.startSignature()

//iniciando la firma para el documento con file_id = 6
id_file=6
firmador.startSignature()