Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

gpt-query

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gpt-query

A TypeScript library designed to streamline queries and integrate with APIs like OpenAI GPT and others. The project is modular, making it simple to maintain and extend functionality.

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
6
Maintainers
0
Weekly downloads
 
Created
Source

GPT Query

A TypeScript library designed to streamline queries and integrate with APIs like OpenAI GPT and others. The project is modular, making it simple to maintain and extend functionality.

Table of Contents

  • Installation
  • Usage
  • Scripts
  • Development
  • Dependencies
  • License

Installation

Use npm or yarn to install the package and its dependencies:

npm install gpt-query

Usage

Importing the Library

Depending on your environment:

For ES Modules:

import GPTQuery from 'gpt-query'

For CommonJS:

const GPTQuery = require('gpt-query')

Scripts

This project provides several npm scripts for development and production tasks:

  • Build Scripts:

    • npm run build:cjs: Build CommonJS modules.
    • npm run build:esm: Build ES Modules.
    • npm run build:types: Generate type definitions.
    • npm run build: Run all build tasks.
  • Development Scripts:

    • npm run dev: Run the development server using tsx.
    • npm run watch: Watch for file changes and recompile.
  • Linting:

    • npm run lint: Check for linting errors using Biome.
    • npm run lint:fix: Fix linting issues automatically.
    • npm run lint:fix:unsafe: Fix linting issues, including unsafe fixes.
  • Testing:

    • npm run test: Run all tests with Jest.
  • Cleaning:

    • npm run clean: Remove all generated files.

Development

To contribute or develop this project locally:

  • Clone the repository.
  • Install dependencies:
    npm install
    
  • Run the development server:
    npm run dev
    
  • Build the project:
    npm run build
    

Running Tests

Ensure your changes don't break functionality by running tests:

npm run test

Dependencies

Production

  • axios: HTTP client for making API requests.
  • cheerio: Scraping and parsing HTML.
  • dotenv: Environment variable management.
  • openai: Integration with OpenAI GPT.

Development

  • @biomejs/biome: Linting tool.
  • @types/jest: TypeScript definitions for Jest.
  • jest: Testing framework.
  • tsx: TypeScript execution.
  • ts-mockito: Mocking library for TypeScript.
  • typescript: TypeScript language support.

License

This project is licensed under the ISC License. See the LICENSE file for more details.

FAQs

Package last updated on 24 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts