Socket
Book a DemoInstallSign in
Socket

@ashiknesin/helpers

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ashiknesin/helpers

Quick helper for side projects

0.0.46
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

AshikNesin's Helpers

This library provides a set of functions to simplify common tasks related to solving captchas, working with AWS services, managing files, and interacting with the Supabase storage. It leverages popular libraries like Axios, Pino, P-Retry, and others to ensure efficient and reliable functionality.

Functions

Captcha Solving

solveCaptcha

async solveCaptcha({
  type: string,             // Optional. Default is "image-to-text"
  base64Image: string,      // Base64-encoded image data
  imageUrl: string,         // URL of the image
  apiKey: string,           // 2Captcha API Key
  waitUntilResponse: bool    // Optional. Default is true
})

Solves a captcha using the 2Captcha service.

AWS

AWS Parameter Store

class paramStore {
  async getParameter(name: string, options?: any): Promise<{ data: string, error: Error }>
  async getParameters(names: string[], options?: any): Promise<{ data: { [name: string]: string }, error: Error }>
  async getManyByPath(path: string, options?: any): Promise<{ data: { [name: string]: string }, error: Error }>
  async get(param: string | string[], options?: any): Promise<{ data: any, error: Error }>
  async set(name: string, value: string): Promise<{ data: any, error: Error }>
}

Provides a convenient interface to interact with AWS Systems Manager Parameter Store.

dynamoDB

class dynamoDB {
  // AWS DynamoDB Document Client instance
}

s3

class s3 {
  async upload(key: string, body: any, options?: any): Promise<{ data: { filePath: string }, error: Error }>
  async download(key: string, destination: string): Promise<{ data: { filePath: string }, error: Error }>
  async remove(keys: string[]): Promise<{ data: { filePaths: string[] }, error: Error }>
  async createSignedUrl(key: string, expiresIn: number): Promise<{ data: { signedUrl: string }, error: Error }>
}

Provides utility functions for interacting with AWS S3.

File Management

zipDirectory

async zipDirectory(inputDirectory: string, outputZipPath: string): Promise<void>

Zips a directory into a specified zip file.

unzipDirectory

async unzipDirectory(inputZipPath: string, outputDirectory: string): Promise<void>

Unzips a zip file into a specified directory.

Supabase

supabaseAdmin

const supabaseAdmin = createClient({
  url: string,
  key: string
})

Creates an instance of the Supabase client for administrative purposes.

supabaseUploadFile

async supabaseUploadFile(bucket: string, filePath: string, fileData: any): Promise<void>

Uploads a file to the Supabase storage.

supabaseDownloadFile

async supabaseDownloadFile(bucket: string, filePath: string, destination: string): Promise<void>

Downloads a file from the Supabase storage.

Usage

import {
  solveCaptcha,
  paramStore,
  dynamoDB,
  s3,
  zipDirectory,
  unzipDirectory,
  supabaseAdmin,
  supabaseUploadFile,
  supabaseDownloadFile
} from 'captcha-solver';

// Example usage
const captchaResult = await solveCaptcha({
  base64Image: 'base64EncodedImageData',
  apiKey: 'your2CaptchaApiKey'
});

const paramValue = await paramStore.getParameter('parameterName');
const s3SignedUrl = await s3.createSignedUrl('objectKey', 3600);

// ... (other examples)

Deps

  • https://github.com/developit/microbundle

License

This library is released under the MIT License.

Keywords

aws

FAQs

Package last updated on 26 Feb 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.