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

jwt-scg

v1.1.2

Published

A simple, secure, and universal JWT library for web and mobile applications - built by SCG

Readme

SCG JWT Token - Universal JWT Library

npm version PyPI version License: MIT GitHub stars

A simple, secure, and universal JWT library available for Node.js and Python. Zero external dependencies, lightweight, and built for enterprise security.

Built by Analytics With Harry and Squid Consultancy Group Limited


Installation

Node.js / JavaScript

npm install jwt-scg

Python

pip install scg-jwt-token

Quick Start

Node.js / JavaScript

const SCGJwtToken = require('jwt-scg');

// Initialize
const jwt = new SCGJwtToken('your-secret-key');

// Create token
const token = jwt.sign({ userId: '12345', email: '[email protected]' });

// Verify token
const payload = jwt.verify(token);
console.log(payload); // { userId: '12345', email: '[email protected]', ... }

Python

from scg_jwt_token import SCGJwtToken

# Initialize
jwt = SCGJwtToken("your-secret-key")

# Create token
token = jwt.sign({"user_id": "12345", "email": "[email protected]"})

# Verify token
payload = jwt.verify(token)
print(payload)  # {"user_id": "12345", "email": "[email protected]", ...}

Key Features

| Feature | Node.js | Python | |---------|---------|---------| | Zero Dependencies | ✅ Native crypto module only | ✅ Standard library only | | TypeScript Support | ✅ Full type definitions | ✅ Type hints included | | Performance Tracking | ✅ Built-in statistics | ✅ Performance monitoring | | Security Features | ✅ HMAC-SHA256, DoS protection | ✅ HMAC-SHA256, secure defaults | | Framework Support | ✅ Express, React, Vue, Angular | ✅ Django, Flask, FastAPI | | Mobile Ready | ✅ React Native compatible | ✅ Cross-platform |


Advanced Usage

Batch Operations (Node.js)

const tokens = jwt.signBatch([
    { userId: '1', role: 'admin' },
    { userId: '2', role: 'user' }
]);

const results = jwt.verifyBatch(tokens);

Security Analysis (Node.js)

const analysis = jwt.analyzeTokenSecurity(token);
console.log(analysis.strength); // 'Strong', 'Medium', 'Weak'

Custom Claims (Both platforms)

// Node.js
const token = jwt.sign(payload, { 
    expiresIn: 3600, 
    issuer: 'my-app', 
    audience: 'mobile-users' 
});

// Python
token = jwt.sign(payload, 
    expires_in=3600, 
    issuer='my-app', 
    audience='mobile-users')

Repository Structure

jwt-scg/
├── <File /> README.md              # Main documentation
├── <File /> package.json           # Node.js package config
├── <File /> index.js               # Node.js main library
├── <File /> index.d.ts             # TypeScript definitions
├── <Folder /> examples/              # Usage examples
│   ├── backend-example.js    # Express.js integration
│   ├── frontend-example.js   # React/Vue usage
│   └── mobile-react-native.js # React Native
├── <Folder /> test/                  # Test suites
├── <Folder /> python/                # Python package
│   ├── <File /> setup.py           # Python package config  
│   ├── <File /> README.md          # Python documentation
│   ├── <Folder /> scg_jwt_token/     # Python source
│   └── <File /> test_scg_jwt.py    # Python tests
└── <File /> LICENSE                # MIT License

Framework Integration

Express.js Middleware

const authMiddleware = (req, res, next) => {
    const token = req.headers.authorization?.replace('Bearer ', '');
    try {
        req.user = jwt.verify(token);
        next();
    } catch (error) {
        res.status(401).json({ error: 'Invalid token' });
    }
};

app.use('/api/protected', authMiddleware);

Django Middleware

from django.http import JsonResponse
from scg_jwt_token import SCGJwtToken

class JWTMiddleware:
    def __init__(self, get_response):
        self.get_response = get_response
        self.jwt = SCGJwtToken(settings.SECRET_KEY)
    
    def __call__(self, request):
        auth_header = request.META.get('HTTP_AUTHORIZATION', '')
        if auth_header.startswith('Bearer '):
            token = auth_header[7:]
            try:
                request.user_data = self.jwt.verify(token)
            except ValueError:
                return JsonResponse({'error': 'Invalid token'}, status=401)
        
        return self.get_response(request)

Performance & Security

Security Features

  • HMAC-SHA256: Industry standard algorithm
  • DoS Protection: 64KB payload limit (Node.js)
  • Timing Attack Prevention: Constant-time comparison
  • No External Dependencies: Reduced attack surface

Performance Benchmarks

  • Node.js: 50,000+ tokens/second
  • Python: 25,000+ tokens/second
  • Memory Usage: <2MB footprint
  • Startup Time: <10ms initialization

Package Links

| Platform | Package | Repository | |----------|---------|------------| | npm | jwt-scg | Node.js/TypeScript | | PyPI | scg-jwt-token | Python 3.7+ | | GitHub | analyticswithharry/scg-jwt-token | Source Code |


About the Authors

Analytics With Harry - Squid Consultancy Group Limited

We specialize in building secure, scalable software solutions for enterprises and startups worldwide.


Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.


Star History

If you find this project helpful, please consider giving it a star on GitHub!

Star History Chart


Made with by Squid Consultancy Group Limited