Socket
Book a DemoInstallSign in
Socket

@edwardxyt/gws-utils

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@edwardxyt/gws-utils

node javascripts utils

1.0.6
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Node.js: @edwardxyt/gws-utils

用于nodejs 常用工具类。

Installation

npm install @edwardxyt/gws-utils

Usage

const gwsUtils = require('@edwardxyt/gws-utils');

Methods

globalLoader(pattern)

遍历目录中所有包含特定名称的文件。

Example:
const {globalLoader} = require('@edwardxyt/gws-utils');

// 获取utils目录下所有.js文件,返回一个数组。
globalLoader(`${__dirname}/utils/**/*.js`).then(result => {
    console.log(result)
});
getModules(dir, type)

加载目录下制定名称的模块文件。

Example:
const {getModules} = require('@edwardxyt/gws-utils');

// 获取lib目录下所有.js的模块。
let myModules = getModules(path.join(__dirname, './lib'),'.js');
bubbleSort(arr)

冒泡排序

Example:
const {arraySort} = require('@edwardxyt/gws-utils');

arraySort.bubbleSort([1,2,3]).then(data => {
    log(data)
})

FAQs

Package last updated on 07 Aug 2019

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.