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

smartca

v1.2.0

Published

AI-powered Smart Contract Auditor using Hugging Face

Downloads

9

Readme

smartca

smartca is a powerful NPM package that allows users to audit their smart contracts efficiently. With its user-friendly interface and robust features, smartca streamlines the smart contract auditing process.

Installation

Install the package using npm:

npm i smartca

Usage

Follow these steps to use smartca for auditing your smart contracts:

  1. Create an example.js file with the following code:

    import { SmartCA } from 'smartca';
    import dotenv from 'dotenv';
    import fs from 'fs';
    import path from 'path';
    
    // Load environment variables
    dotenv.config();
    
    async function analyzeMyContract(contractPath) {
        try {
            // Check if file path is provided
            if (!contractPath) {
                console.error('Please provide the path to your smart contract file');
                console.log('Usage: node example.js <path-to-contract>');
                process.exit(1);
            }
    
            // Read the contract file
            const contractCode = fs.readFileSync(contractPath, 'utf8');
               
            // Initialize SmartCA with your Hugging Face API key
            const analyzer = new SmartCA(process.env.HUGGINGFACE_API_KEY);
               
            // Analyze the contract
            const analysis = await analyzer.analyzeContract(contractCode);
               
            // Print results
            console.log(`\nAnalyzing contract: ${path.basename(contractPath)}\n`);
            console.log('Analysis Results:');
            console.log('Security Score:', analysis.securityScore);
            console.log('Code Quality Score:', analysis.codeQualityScore);
            console.log('Performance Score:', analysis.performanceScore);
               
            console.log('\nRecommendations:');
            analysis.recommendations.forEach((rec, index) => {
                console.log(`${index + 1}. ${rec}`);
            });
               
            console.log('\nMetrics:');
            console.log('Function Count:', analysis.metrics.functionCount);
            console.log('State Variables:', analysis.metrics.stateVariables);
            console.log('Complexity Score:', analysis.metrics.complexity);
        } catch (error) {
            if (error.code === 'ENOENT') {
                console.error('Error: Contract file not found');
            } else {
                console.error('Analysis failed:', error);
            }
        }
    }
    
    // Get the contract file path from command line arguments
    const contractPath = process.argv[2];
    
    // Run the analysis
    analyzeMyContract(contractPath);
  2. Run the following command in your terminal to audit your smart contract:

    node example.js path/to/your/contract.sol

Features

  • Comprehensive Audits: Analyze your smart contracts for potential vulnerabilities.
  • Detailed Reports: Get insights and recommendations to improve your smart contract security.
  • Ease of Use: Designed to be simple and effective for both beginners and professionals.

Configuration

Make sure you have a .env file in your project directory containing your Hugging Face API key:

HUGGINGFACE_API_KEY=your-api-key

License

This package is licensed under the MIT License.


Feel free to contribute or report any issues to help improve smartca!