New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

apipost-tools

Package Overview
Dependencies
Maintainers
6
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apipost-tools

apipost-tools

latest
npmnpm
Version
0.0.41
Version published
Maintainers
6
Created
Source

A-Design Logo

apipost-tools 是一个一致性、模块化、高性能的 JavaScript 实用工具库。

安装

npm i apipost-tools

基础使用

需引入:

import ATools from 'apipost-tools';
let json='{"name":"我是一名ApiPost用户"}';
let email='1030698842@qq.com';

ATools.isJson(json); //true
ATools.isEmail(email); //true

目前支持:
array2Tree //扁平数据转树状结构
beautifyRaw // 美化数据,目前支持object,xml,html,jsonp,javascript. 返回结果为对象。包含mode(类型),value(美化后的结果)
formatXml //格式化xml数据
getUrlQuery //获取url中的query数据(对象)。
getUrlQueryArray //获取url中的query数据(数组)。
isEmail //验证邮箱格式
isXml // 验证是否为xml格式
isJson //验证是否为json格式
isJson5 //验证是否为json5格式
isJsonp //验证是否为jsonp格式
isHtml //验证是否为html格式
ms2second //毫秒时间戳转秒时间戳
formatHtml // 格式化html数据
jsonp2Obj // jsonp格式转为对象
errorResult // 统一失败结果对象
successResult // 统一成功结果对象
bufferToRaw // buffer转raw
completionHttpProtocol // 补齐http协议开头
NewURL // 根据url生成url对象
setObjValByPath // 根据对象路径给对象赋值,例如a.b.c  没有的属性会默认补上对象。

开源协议

apipost-tools 遵循 MIT 协议

Keywords

tools

FAQs

Package last updated on 30 Jun 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