
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
美术 JavaScript SDK for QuickApp,提供快应用开发所需的核心功能模块。
npm install @ms/js-sdk
import MsSdk, { MsHttp, MsStorage, MsUtils, MsAuth } from '@ms/js-sdk'
// 初始化 SDK
const sdk = new MsSdk({
baseUrl: 'https://your-api.com',
timeout: 30000,
apiKey: 'your-api-key'
})
const http = new MsHttp('https://api.example.com')
// GET 请求
const response = await http.get('/users')
// POST 请求
const result = await http.post('/users', {
name: 'John',
email: 'john@example.com'
})
const storage = new MsStorage()
// 存储数据
await storage.set('user', { name: 'John', age: 30 })
// 获取数据
const user = await storage.get('user')
// 删除数据
await storage.remove('user')
// 格式化日期
const formatted = MsUtils.formatDate(new Date(), 'YYYY-MM-DD')
// 生成 ID
const id = MsUtils.generateId(10)
// 防抖函数
const debouncedFn = MsUtils.debounce(() => {
console.log('Debounced!')
}, 300)
// 节流函数
const throttledFn = MsUtils.throttle(() => {
console.log('Throttled!')
}, 1000)
const auth = new MsAuth()
// 登录
const { token, userInfo } = await auth.login({
username: 'john',
password: 'password123'
})
// 检查登录状态
const isLoggedIn = await auth.isLoggedIn()
// 获取用户信息
const user = await auth.getUserInfo()
// 登出
await auth.logout()
主 SDK 类,用于全局配置管理。
constructor(config?: MsSdkConfig)getConfig(): MsSdkConfig - 获取当前配置updateConfig(newConfig: Partial<MsSdkConfig>): void - 更新配置HTTP 请求模块。
get<T>(url: string, options?: HttpOptions): Promise<HttpResponse<T>>post<T>(url: string, data?: any, options?: HttpOptions): Promise<HttpResponse<T>>put<T>(url: string, data?: any, options?: HttpOptions): Promise<HttpResponse<T>>delete<T>(url: string, options?: HttpOptions): Promise<HttpResponse<T>>本地存储模块。
set(key: string, value: any): Promise<void>get<T>(key: string, defaultValue?: T): Promise<T>remove(key: string): Promise<void>clear(): Promise<void>keys(): Promise<string[]>工具函数模块。
formatDate(date: Date, format?: string): stringgenerateId(length?: number): stringdebounce<T>(func: T, wait: number): Tthrottle<T>(func: T, limit: number): TdeepClone<T>(obj: T): TisValidEmail(email: string): booleanisValidPhone(phone: string): boolean用户认证模块。
login(params: LoginParams): Promise<{ token: string; userInfo: UserInfo }>logout(): Promise<void>getToken(): Promise<string | null>getUserInfo(): Promise<UserInfo | null>isLoggedIn(): Promise<boolean>refreshToken(): Promise<string>npm run buildnpm publishMIT
FAQs
美数 JavaScript SDK for QuickApp
We found that ms-js-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.