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

skyot

v1.4.5

Published

Módulo que adapta varios módulos terceiros

Downloads

25

Readme

Skyot Camada Anticorrupção

  • Integração do sistemas com bibliotecas externas

Descrição

Às vezes, temos que integrar sistemas que estão em contextos delimitados diferentes. Por exemplo, um sistema A precisa usar serviços de um sistema B, que pode inclusive ser um sistema externo, isto é, de uma outra organização. Para evitar que A tenha que se adaptar e usar, mesmo que parcialmente, a linguagem ubíqua de B, pode-se usar uma Camada Anticorrupção para mediar essa comunicação.

Sistema A -> [ Skyot ] -> Sistema B

Instalação

  npm install skyot

Como utilizar o skyot

SkyotLogger

  • Um decorate que fornece log do método, parâmetros e a saída.
// message = "Hello World"
import { SkyotLogger } from "skyot";

class A {
  @SkyotLogger()
  public helloWord(message: string): string {
    return message;
  }
}
  • Terminal
[1644933258393] INFO (254625): Method => "helloWord"
[1644933258393] INFO (254625): Params => [ "Hello World" ]
[1644933258393] INFO (254625): Return => "Hello World"

Logger

  • Uma versão mais perfomática que o console.log() tradicional
// message = "Hello World"
import { logger } from "skyot";

class A {
  
  public helloWord(message: string) {
    logger(message)
  }
}
  • Terminal
[1644933258393] INFO (254625): "Hello World"

Crypto

  • Uma abstração da biblioteca crypto

encrypted

// message = "Hello World"
import { SkyotCrypto, logger } from "skyot";

class A {
  
  public helloWord(message: string) {
    const secretKey = '123'
    const messageEncrypted = SkyotCrypto.encrypted("hello world", secretKey)
    logger(messageEncrypted)
  }
}
  • Terminal
[1645102590429] INFO (62682): U2FsdGVkX19p0dG0o5IA9GHwQxgEcwZCDMZdJm871NM=

descrypted

// message = "Hello World"
import { SkyotCrypto, logger } from "skyot";

class A {
  
  public helloWord(message: string) {
    const secretKey = "123";
    const messageEncripeted = 'U2FsdGVkX1/Okp/eZ/U7A4eTdf5/EIsp4iIxvy6+z00='
    
    const messagedDescrypted = SkyotCrypto.descrypted(messageEncripeted, secretKey);
    logger(messagedDescrypted);
  }
}
  • Terminal
[1645102751367] INFO (63524): "hello world"

JWT

  • Os JSON Web Tokens são um método RFC 7519 padrão do setor aberto para representar declarações de forma segura entre duas partes.

generateJwt

// message = "Hello World"
import { SkyotJWT, logger } from "skyot";

class A {
  
  public helloWord(message: string) {
    const token = SkyotJWT.generateJwt({name:"Skyot"})
    logger(token);
  }
}
  • Terminal
[1645117856084] INFO (75716 on wilson-Vostro-3480): eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiU2t5b3QiLCJpYXQiOjE2NDUxMTc4NTYsImV4cCI6MTY0NTIwNDI1Nn0.TOjcCs4dVIfBcwQtdjitXMslaS-dffkDOlHDOoTVNH8

decodeJwt

// message = "Hello World"
import { SkyotJWT, logger } from "skyot";

class A {
  
  public helloWord(message: string) {
    const token ='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiU2t5b3QiLCJpYXQiOjE2NDUxMTc4NTYsImV4cCI6MTY0NTIwNDI1Nn0.TOjcCs4dVIfBcwQtdjitXMslaS-dffkDOlHDOoTVNH8'
    const payload = SkyotJWT.decodeJwt(token)
    logger(payload);
  }
}
  • Terminal
[1645118123549] INFO (76417 on wilson-Vostro-3480):
    header: {
      "alg": "HS256",
      "typ": "JWT"
    }
    payload: {
      "name": "Skyot",
      "iat": 1645117856,
      "exp": 1645204256
    }
    signature: "TOjcCs4dVIfBcwQtdjitXMslaS-dffkDOlHDOoTVNH8"

Contato

  • Author - Wilson Felipe Github Linkedin

License

MIT licensed.