掃二維碼與項(xiàng)目經(jīng)理溝通
我們在微信上24小時期待你的聲音
解答本文疑問/技術(shù)咨詢/運(yùn)營咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流
Lodash是一個一致性、模塊化、高性能、提高開發(fā)者效率的JavaScript 實(shí)用工具庫。Lodash 通過降低 array、number、objects、string 等等的使用難度從而讓 JavaScript 變得更簡單。Lodash 的模塊化方法,非常適用于:

在網(wǎng)站設(shè)計(jì)制作、成都網(wǎng)站設(shè)計(jì)過程中,需要針對客戶的行業(yè)特點(diǎn)、產(chǎn)品特性、目標(biāo)受眾和市場情況進(jìn)行定位分析,以確定網(wǎng)站的風(fēng)格、色彩、版式、交互等方面的設(shè)計(jì)方向。創(chuàng)新互聯(lián)還需要根據(jù)客戶的需求進(jìn)行功能模塊的開發(fā)和設(shè)計(jì),包括內(nèi)容管理、前臺展示、用戶權(quán)限管理、數(shù)據(jù)統(tǒng)計(jì)和安全保護(hù)等功能。
Github:https://github.com/lodash/lodash。
Underscore.js 是一個實(shí)用的 JavaScript 工具庫,它提供了一整套函數(shù)式編程的實(shí)用功能,但沒有擴(kuò)展任何 JavaScript 內(nèi)置對象,而是將數(shù)據(jù)封裝在一個自定義對象中。
Github:https://github.com/jashkenas/underscore。
Ramda 的目標(biāo)是專門為函數(shù)式編程風(fēng)格而設(shè)計(jì),更容易創(chuàng)建函數(shù)式 pipeline、且從不改變用戶已有數(shù)據(jù)。Ramda 主要特性如下:
Github:https://github.com/ramda/ramda。
collect.js是 JavaScript 處理數(shù)組和對象的方便且無依賴的包裝類工具。其提供了常用的數(shù)組和集合的操作API,map,reduce,filter 等集合的高級方法,設(shè)計(jì)靈感來源于 Laravel Collection。
Github:https://github.com/ecrmnn/collect.js/。
date-fns 是一個現(xiàn)代的 JavaScript 日期工具類庫,提供了最全面、最簡單和一致的工具集,用于在瀏覽器和 Node.js 中操作 JavaScript 日期。其具有以下特性:
import { format, formatDistance, formatRelative, subDays } from 'date-fns'
format(new Date(), "'Today is a' eeee")
//=> "Today is a Saturday"
formatDistance(subDays(new Date(), 3), new Date(), { addSuffix: true })
//=> "3 days ago"
formatRelative(subDays(new Date(), 3), new Date())
//=> "last Friday at 7:26 p.m."Github:https://github.com/date-fns/date-fns。
Moment.js 是一個簡單易用的輕量級 JavaScript 日期處理類庫,提供了日期格式化、解析、驗(yàn)證等功能。它支持在瀏覽器和 NodeJS 兩種環(huán)境中運(yùn)行。此類庫能夠?qū)⒔o定的任意日期轉(zhuǎn)換成多種不同的格式,具有強(qiáng)大的日期計(jì)算功能,同時也內(nèi)置了能顯示多樣的日期形式的函數(shù)。
Github:https://github.com/moment/moment/。
Day.js是一個極簡的JavaScript庫,可以為現(xiàn)代瀏覽器解析、驗(yàn)證、操作和顯示日期和時間。其具有以下特點(diǎn):
dayjs().format(); // 2020-09-08T13:42:32+08:00
dayjs().format('YYYY-MM-DD'); // 2020-09-08
dayjs().format('YYYY-MM-DD HH:mm:ss'); // 2020-09-08 13:47:12
dayjs(1318781876406).format('YYYY-MM-DD HH:mm:ss'); // 2011-10-17 00
Github:https://github.com/iamkun/dayjs/。
Chance 是一個輕量級的 JavaScript 隨機(jī)字符串生成器插件,可幫助減少編寫單調(diào)的代碼,特別是在編寫自動化測試時經(jīng)常需要各種隨機(jī)內(nèi)容??梢允褂盟鼇懋a(chǎn)生隨機(jī)數(shù)、字符、字符串、名字、地址、骰子等。
Github:https://github.com/chancejs/chancejs。
UUID 是一個用于在 JavaScript 中生成符合 RFC 的 UUID 的實(shí)用程序庫。其具有以下特點(diǎn):
Github:https://github.com/uuidjs/uuid。
nanoid 是一個小巧、安全、URL友好、唯一的 JavaScript 字符串ID生成器。其具有以下特性:
import { nanoid } from 'nanoid'
model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT"Github:https://github.com/ai/nanoid。
Math.js 是一個強(qiáng)大的 JavaScript 和 Node.js 數(shù)學(xué)庫。它具有支持符號計(jì)算的靈活表達(dá)式解析器,帶有大量內(nèi)置函數(shù)和常量,并提供了一個集成的解決方案來處理不同的數(shù)據(jù)類型,如數(shù)字、大數(shù)、復(fù)數(shù)、分?jǐn)?shù)、單位和矩陣。功能強(qiáng)大且易于使用。
Github:https://github.com/josdejong/mathjs。
Numeral.js 是一個用來對數(shù)值進(jìn)行操作和格式化的 JS 庫??蓪?shù)字格式化為貨幣、百分比、時間,甚至是序數(shù)詞的縮寫(比如1st,100th)。
Github:https://github.com/adamwdraper/Numeral-js。
Accounting.js 是一個用于數(shù)字、貨幣和貨幣解析/格式化的小型 JavaScript 庫。它是輕量級的,完全可本地化的,沒有依賴關(guān)系,并且在客戶端或服務(wù)器端都可以很好地工作。使用獨(dú)立或作為 nodeJS/npm 和 AMD/requireJS 模塊。
// Default usage:
accounting.formatMoney(12345678); // $12,345,678.00
// European formatting (custom symbol and separators), can also use options object as second parameter:
accounting.formatMoney(4999.99, "€", 2, ".", ","); // €4.999,99
// Negative values can be formatted nicely:
accounting.formatMoney(-500000, "£ ", 0); // £ -500,000
// Simple `format` string allows control of symbol position (%v = value, %s = symbol):
accounting.formatMoney(5318008, { symbol: "GBP", format: "%v %s" }); // 5,318,008.00 GBP
Github:https://github.com/openexchangerates/accounting.js。
qs是一個url參數(shù)轉(zhuǎn)化(parse和stringify)的JavaScript庫??梢园迅袷交淖址D(zhuǎn)換為對象格式。
var qs = require('qs');
var assert = require('assert');
var obj = qs.parse('a=c');
assert.deepEqual(obj, { a: 'c' });
var str = qs.stringify(obj);
assert.equal(str, 'a=c');Github:https://github.com/ljharb/qs。
Voca 是一個用于操作字符串的 JavaScript 庫。Voca 庫提供了有用的函數(shù)來使字符串操作更加舒適:更改大小寫、修剪、填充、slugify、拉丁化、sprintfy、截斷、轉(zhuǎn)義等。模塊化設(shè)計(jì)允許加載整個庫或單個函數(shù)以最小化應(yīng)用程序構(gòu)建。該庫經(jīng)過全面測試、有據(jù)可查并長期受支持。
v.camelCase('bird flight'); // => 'birdFlight'
v.sprintf('%s costs $%.2f', 'Tea', 1.5); // => 'Tea costs $1.50'
v.slugify('What a wonderful world'); // => 'what-a-wonderful-world'Github:https://github.com/panzerdp/voca。
js-cookie.js 是一個用于處理瀏覽器 cookie 的簡單、輕量級 JavaScript API。其具有以下特點(diǎn):
Github:https://github.com/js-cookie/js-cookie。
Cookies 是一個用于獲取和設(shè)置 HTTP(S) cookie的node.js模塊。它的特點(diǎn)如下:
var http = require('http')
var Cookies = require('cookies')
// Optionally define keys to sign cookie values
// to prevent client tampering
var keys = ['keyboard cat']
var server = http.createServer(function (req, res) {
// Create a cookies object
var cookies = new Cookies(req, res, { keys: keys })
// Get a cookie
var lastVisit = cookies.get('LastVisit', { signed: true })
// Set the cookie to a value
cookies.set('LastVisit', new Date().toISOString(), { signed: true })
if (!lastVisit) {
res.setHeader('Content-Type', 'text/plain')
res.end('Welcome, first time visitor!')
} else {
res.setHeader('Content-Type', 'text/plain')
res.end('Welcome back! Nothing much changed since your last visit at ' + lastVisit + '.')
}
})
server.listen(3000, function () {
console.log('Visit us at http://127.0.0.1:3000/ !')
})GitHub:https://github.com/pillarjs/cookies。
DOMPurify 是一個開源的基于DOM的快速XSS凈化工具。輸入HTML元素,然后通過DOM解析遞歸元素節(jié)點(diǎn),進(jìn)行凈化,輸出安全的HTML。
Github:https://github.com/cure53/DOMPurify。

我們在微信上24小時期待你的聲音
解答本文疑問/技術(shù)咨詢/運(yùn)營咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流