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

johayo-jwt

v0.2.1

Published

JWT authentication middleware.

Readme

#Johayo JWT 기존 JWT 미들웨어를 사용하여, express에서 사용하기 편하게 만들었습니다. JWT에 대한 설명은 Go to jwt.io에서 확인해보시면 됩니다.

##설치

$ npm install johayo-jwt

##업데이트 jsonwebtoken 버젼업.

##사용 제가 만든 jwt는 한번더 암호화를 진행하여 보안에 조금 신경 쓴 타입입니다. 그리고 만료시간을 두어 좀더 효과적으로 사용 가능하게 하였습니다. 복호화한 후 정보들은 설정을 따로 하지 않으면 'req.user'에 저장됩니다.

####1. 설정

var johayoJwt = require("johayo-jwt");

app.use(johayoJwt({
    /* jwt 토큰의 데이터부분을 한번더 암호화 할때 쓰는 암호화키 */
    tokenSecret: "SecretKey",
    /* jwt 자체 암호화 키 */
    jwtSecret: "SecretKey",
    /* jwt 암호화 알고리즘(디폴트: HS256) */
    algorithm: "HS256",
    /* 만료시간 초단위 (디폴트: 3600 - 1시간) */
    expireTime: 3600,
    /* 복호화 한후 정보 저장위치(디폴트: req.user) */
    userProperty: "user"
}))

####2. 복호화

app.get('/', johayoJwt.verify, function(req, res){
    console.log(req.user);
})

####3. 암호화

johayoJwt.encode(data, expireTime);

expireTime 없으면 기존 설정한데로 들어간다.

####4. 에러 에러는 전부 throw로 처리 되며 복호화 시 error status는 401로 셋팅 됩니다. 에러 메세지는 jsonwebtoken의 에러 메시지를 참고 하시면 됩니다. 그외 에러메세지는 아래와 같습니다.

  • Format is Authorization: Bearer 'token'
  • req.headers.authorization was not found

####5. 기존 jsonwebtoken 다른점 자주 사용하는 express에서 사용하기 편하게 만들었으며, 만료시간을 필수로 놓게 해놨습니다. 그리고 jsonwebtoken를 이용한 암호화 한 것을 한번더 암호화 하는 방식을 채택했습니다. jwt 전체를 암호화 하지는 않고 jwt에서 base64로 암호화한 claim json부분을 한번 더 aes 256 cbc 암호화 알고리즘으로 암호화 하였습니다.