Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@devup-api/utils

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@devup-api/utils

npmnpm
Version
0.1.5
Version published
Maintainers
1
Created
Source

@devup-api/utils

Utility functions for OpenAPI processing and file operations.

Installation

npm install @devup-api/utils

Exports

Case Conversion Functions

  • toCamel(str: string): string - Convert string to camelCase
  • toSnake(str: string): string - Convert string to snake_case
  • toPascal(str: string): string - Convert string to PascalCase

File Operations

  • readOpenapi(filePath?: string): OpenAPIV3_1.Document - Read and parse OpenAPI JSON file (synchronous)
  • readOpenapiAsync(filePath?: string): Promise<OpenAPIV3_1.Document> - Read and parse OpenAPI JSON file (asynchronous)
  • writeInterface(filePath: string, content: string): void - Write TypeScript interface file (synchronous)
  • writeInterfaceAsync(filePath: string, content: string): Promise<void> - Write TypeScript interface file (asynchronous)
  • createTmpDir(tempDir?: string): string - Create temporary directory (synchronous)
  • createTmpDirAsync(tempDir?: string): Promise<string> - Create temporary directory (asynchronous)

Usage

Case Conversion

import { toCamel, toSnake, toPascal } from '@devup-api/utils'

toCamel('hello_world') // 'helloWorld'
toSnake('helloWorld') // 'hello_world'
toPascal('hello_world') // 'HelloWorld'

File Operations

import { readOpenapiAsync, writeInterfaceAsync, createTmpDirAsync } from '@devup-api/utils'

// Read OpenAPI schema
const schema = await readOpenapiAsync('openapi.json')

// Create temp directory
const tempDir = await createTmpDirAsync('my-temp-dir')

// Write interface file
await writeInterfaceAsync('api.d.ts', interfaceContent)

License

Apache 2.0

FAQs

Package last updated on 01 Dec 2025

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