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

tool-helper

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tool-helper

Some simple functions that are commonly used in life or office.About fs / http / ffmpeg / message / logger

latest
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

tool-helper

Some simple functions that are commonly used in life or office.About fs / http / ffmpeg / message / logger .

Install

npm i tool-helper --save

Usage

common

import {common} from 'tool-helper'
const {
  //node-uuid 
  uuid,
  //crypto md5
  md5,
  //setTimeout in promise
  sleep,
  //get a datetime string
  datetime,
  //get a human readable size like 20MB
  humanSize,
  //get a human readable time like 20 minutes ago
  getHumanTime,
  //readable stream pipe to write stream
  rs2ws
} = common;

download

//node-fetch
import {download} from 'tool-helper'
let ins = new download('https://minioapi.byyui.com:9999/zztemp/test.mp4','./test.mp4');
//download progress
ins.on('progress',info=>{
  console.log(info);
});
let rs = await ins.download();

//or json / html / post / m3u8

ffmpeg

import {ffmpeg} from 'tool-helper'
const {getImage,getM3u8,getVideo} = ffmpeg;
//Please install ffmpeg on os before using it
//through 'child_process' call ffmpeg bin

fileutil

import {fileutil} from 'tool-helper'
const {mkdir,existsFile,isFile,deldir,listFiles,getMd5,base64} = image;
//these functions just like these names,but dit not do any safe check

logger

import {getLogger} from 'tool-helper'
//log4js
const logger = getLogger('test');
logger.info('some message');

useragent

import {useragent} from 'tool-helper'
const {
  //get a random useragent like 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36'
  getRandom,
  //get a device information throuth useragent
  devices
} = useragent;

message

//dingtalk and mail
import {message} from 'tool-helper'
const {dingding,mail} = message;

License

The MIT LICENSE.

FAQs

Package last updated on 23 Jan 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