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 🙏

© 2024 – Pkg Stats / Ryan Hefner

control-consultas-doc

v2.0.5

Published

Consultas de nro de documentos a las diferentes entidades publicas del estado de l Perú

Downloads

112

Readme

Control - Consultas Documentos - Sunat - Reniec

Consultas de Nro. de documentos a las diferentes entidades públicas del estado del Perú (Sunat - Reniec)

Comenzando 🚀

Requerimientos 📋

  • NodeJS 10.16
  • TypeScript 3.4 o Superior

Instalación 📖

Para instalar clona este Repositorio ó directamente desde el gestor de paquetes de NodeJS (NPM)

Clonar 📦

git clone https://github.com/ZMALIM/control.git
cd control-consultas-doc
npm install
npm run start

Instalar con NPM 🔧

npm install --save 'control-consultas-doc';

control-consultas-doc se define como una dependencia.

Pruebas ⚙️

Uso - Funcionamiento 🔩

Importamos el modulo control-consultas-doc en la tipica importacion en ES6 - ES7 (TypeCript - JavaScript)

import { Sunat, Contribuyente } from 'control-consultas-doc';

Consulta de RUC ⌨️

Para realizar la consulta del un numero de RUC hacemos uso del metodo consultaRuc lo cual esto nos devolvera una promesa de tipo Contribuyente

const sunat = new Sunat();
sunat.consultaRuc('12345678912')
    .then(contribuyente: Contribuyente => {
        console.log(contribuyente)
    })
    .catch(error => {
        console.log(error)
    });

Async/Await

Tambien podemos hacer uso del Async/Await, La finalidad de los operadores async y await es simplificar aun más la forma en que trabajamos con las promesas.

class Consulta 
{
    public consultaRuc(ruc: string): Promise<Contribuyente> 
    {
        const sunat = new Sunat();
        return sunat.consultaRuc(ruc);
    }
}

Respuesta

contribuyente

{
    ruc: string;
    razonSocial: string;
    tipo: string;
    tipoDocumento: string;
    nombreComercial: string;
    fechaInscripcion: string;
    fechaInicioActividades: string;
    estado: string;
    fechaBaja: string;
    condicion: string;
    profesionUOficio: string;
    direccion: string;
    departamento: string;
    provincia: string;
    distrito: string;
    sistemaEmisionComprobante: string;
    sistemaContabilidad: string;
    actividadComercioExterior: string;
    actividadesEconomicas: string[];
    comprobantesPago: string[];
    comprobantesPagoElectronico: string[];
    sistemaEmisionElectronica: string[];
    fechaEmisorElectronico: string;
    cpe: string[];
    fechaAfiliadoPLE: string;
    padrones: string[];
    telefonos: string[];
    fax: string;
    principalCIIU: string;
    secundario1CIIU: string;
    secundario2CIIU: string;
    afectoNuevoRUS: string;
    buenContribuyente: string
    agenteRetencion: string;
    agentePercepcionVtaInt: string;
    agentePercepcionComLiq: string;
}

Construido con 🛠️

Apoyo 🎁

control-consultas-doc es un proyecto de código abierto, construido con el lenguaje de programación TypeScript, aún esta en face de prueba, cualquier tipo de apoyo es bienvenido.

  • Comenta a otros sobre este proyecto 📢.
  • Comenta sobres las mejoras que encuentras 🤓.

Autor ✒️

  • LeonelHS - Cuenta de Facebook Cualquier duda o critica.