New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc