twc-math-utils
v1.0.15
Published
A simple TypeScript package for testing npm publishing
Readme
twc-math-utils
A TypeScript package providing math utilities and proto types.
Installation
npm install twc-math-utilsUsage
전체 패키지 사용 (All-in-one)
const {
add,
subtract,
multiply,
divide,
Agent,
LineMessage,
} = require('twc-math-utils');
console.log(add(2, 3)); // 5
console.log(typeof Agent); // object개별 모듈 사용 (Modular)
수학 유틸리티만 사용
// 수학 모듈만 import
const math = require('twc-math-utils/dist/math');
console.log(math.add(5, 3)); // 8
console.log(math.sqrt(16)); // 4
// 또는 destructuring으로
const {
add,
subtract,
multiply,
divide,
abs,
round,
ceil,
floor,
max,
min,
sqrt,
pow,
} = require('twc-math-utils/dist/math');Proto 타입만 사용
// Proto 모듈만 import
const proto = require('twc-math-utils/dist/proto');
console.log(typeof proto.Agent); // object
console.log(typeof proto.LineMessage); // object
// 또는 destructuring으로
const {
Agent,
LineMessage,
ErrorResponse,
LineChannel,
} = require('twc-math-utils/dist/proto');API
Math Utilities
add(a, b)- 두 숫자를 더합니다subtract(a, b)- 두 숫자를 뺍니다multiply(a, b)- 두 숫자를 곱합니다divide(a, b)- 두 숫자를 나눕니다abs(x)- 절댓값을 반환합니다round(x)- 반올림합니다ceil(x)- 올림합니다floor(x)- 내림합니다max(a, b)- 더 큰 값을 반환합니다min(a, b)- 더 작은 값을 반환합니다sqrt(x)- 제곱근을 반환합니다pow(base, exponent)- 거듭제곱을 반환합니다
Proto Types
- Agent 관련:
Agent,ExternalAgent,CookieAgent,LoginAgentRequest,LoginAgentResponse등 - Line Message 관련:
LineMessage,LineMessageComposite등 - Line Channel 관련:
LineChannel,BubbleMessage,LineChannelMessage등 - Error 관련:
ErrorResponse - Event 관련:
PageViewEvent,CreatePageViewEventRequest등 - AI 관련:
AgentAiChatLog,MultiGetAgentAiChatLogRequest등 - File Upload 관련:
FileUploadRequest,FileUploadResponse등
모듈 구조
twc-math-utils/
├── dist/
│ ├── index.js # 전체 패키지 (수학 + Proto)
│ ├── math.js # 수학 유틸리티만
│ └── proto.js # Proto 타입만License
ISC
