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

ailint

v1.1.9

Published

该项目的主要功能是分析一个软件项目的代码,找出可能存在的BUG并提出合理的改进建议。项目会读取软件的目录结构及文件内容,通过调用AI服务进行分析,并将结果输出到一个指定的文件中。

Downloads

1

Readme

AILint

该项目的主要功能是分析一个软件项目的代码,找出可能存在的BUG并提出合理的改进建议。项目会读取软件的目录结构及文件内容,通过调用AI服务进行分析,并将结果输出到一个指定的文件中。

功能简介

  1. 读取项目目录,过滤不必要的文件和文件夹。
  2. 根据项目目录结构和文件内容,生成分析请求的输入。
  3. 调用AI服务分析代码,找出BUG并提出改进建议。
  4. 将分析结果输出到指定文件。

使用方法

环境准备

在使用该工具前,请确保已安装Node.js环境,并设置环境变量 AILINT_TOKEN,该变量用于存储AI服务的访问令牌。

安装依赖

npm install -g ailint

通过CLI传入参数

ailint -d <项目目录> -e <引擎> -t <令牌> -o <输出路径>
  • -d:指定项目目录路径,默认为当前工作目录。
  • -e:指定AI引擎,默认为 gpt-4o
  • -t:指定AI服务的访问令牌。
  • -o:指定结果输出路径,默认为项目目录下的 ailint_result.txt

使用配置文件

在项目根目录下创建 ailint.config.json 配置文件,内容格式如下:

{
    "directory": "<项目目录>",
    "engine": "<引擎>",
    "ignoreFolders": ["<忽略的文件夹或文件>"]
}
  • directory:指定项目目录路径。
  • engine:指定AI引擎。
  • ignoreFolders:指定需要忽略的文件或文件夹。

参数优先级

CLI传入参数的优先级高于配置文件中的参数,例如同时指定了CLI参数和配置文件参数,则以CLI参数为准。

示例

先设置环境变量AILINT_TOKEN

export AILINT_TOKEN=your_secret_token
ailint -d ./my_project -e gpt-4o -t your_secret_token -o ./results

或使用配置文件 ailint.config.json

{
    "directory": "./my_project",
    "engine": "gpt-4o",
    "ignoreFolders": ["node_modules", ".git"]
}

或使用配置文件 ailint.config.js

module.exports = {
    directory: '/your/default/directory',
    engine: 'gpt-4o',
    // system: '',
    ignoreFolders: [/node_modules/, '__pycache__', 'build', /^\..*/, 'package-lock.json']
}

然后直接运行:

ailint

注意事项

  1. 请确保环境变量 AILINT_TOKEN 已正确设置。
  2. 忽略文件和文件夹的配置支持字符串和正则表达式。
  3. 支持的文件类型包括 .js.jsx.py

问题反馈

如果在使用过程中遇到任何问题,请通过项目的Issue进行反馈。