Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
J

just

> 编程语言
Open source

A library of dependency-free JavaScript utilities that do just one thing.

6.2K stars0 likes2 views
WebsiteGitHub

About

A library of dependency-free JavaScript utilities that do just one thing.

Just

Docs | Why? | Try It | Contribute!

A library of zero-dependency npm modules that do just one thing. A guilt-free alternative to those bulkier utility libraries. Ideal for PWA development or whenever bytes are precious.

We welcome contributions. Please follow our contribution guidelines.

Try :icecream:

A REPL for every utility (powered by RunKit)

Read :books:

  • TRADEOFFS.md -- When to use Just (and when not to).
  • The Zen of Dependency-Free -- Why I wrote Just.

ES and CJS modules available for every utility

All packages support ES module or Common JS syntax without requiring transpilation

// esm (node / bundler)
import clone from 'just-clone';

// esm (native browser code)
import clone from './node_modules/just-clone/index.mjs';

// cjs
const clone = require('just-clone');

TypeScript

We've now added TypeScript definitions and tests for every Just utility

Browser/Platform Support :computer:

Most utilities still work with any platform that supports ES5, but these are the earliest versions guranteed to support every utility. For guidance, any platform that supports spread in array literals will work with Just.

Chrome Safari Firefox Edge Node Mobile Safari Android Chrome
46 8 16 12 6.0 8 46

The Modules :package:

  • Collections {}[]
    • just-diff
    • just-diff-apply
    • just-compare
    • just-clone
    • just-pluck-it
    • just-flush
  • Objects {}
    • just-extend
    • just-merge
    • just-values
    • just-entries
    • just-pick
    • just-omit
    • just-filter-object
    • just-map-object
    • just-map-values
    • just-map-keys
    • just-deep-map-values
    • just-reduce-object
    • just-is-empty
    • just-is-circular
    • just-is-primitive
    • just-safe-get
    • just-safe-set
    • just-typeof
    • just-flip-object
    • just-has
  • Arrays []
    • just-cartesian-product
    • just-unique
    • just-flatten-it
    • just-index
    • just-insert
    • just-intersect
    • just-compact
    • just-last
    • just-tail
    • just-random
    • just-shuffle
    • just-split
    • just-split-at
    • just-order-by
    • just-sort-by
    • just-partition
    • just-permutations
    • just-range
    • just-remove
    • just-union
    • just-zip-it
    • just-group-by
  • Statistics Σ
    • just-mean
    • just-median
    • just-mode
    • just-percentile
    • just-variance
    • just-standard-deviation
    • just-skewness
  • Strings ""
    • just-template
    • just-truncate
    • just-prune
    • just-squash
    • just-left-pad
    • just-right-pad
    • just-camel-case
    • just-kebab-case
    • just-snake-case
    • just-pascal-case
    • just-capitalize
    • just-replace-all
  • Numbers +-
    • just-clamp
    • just-is-prime
    • just-modulo
    • just-random-integer
  • Functions =>
    • just-compose
    • just-curry-it
    • just-demethodize
    • just-flip
    • just-partial-it
    • just-pipe
    • just-debounce-it
    • just-memoize
    • just-memoize-last
    • just-random
    • just-throttle
    • just-once

Collections

just-diff

source

Try it

npm install just-diff
yarn add just-diff

Return an object representing the difference between two other objects Pass converter to format as http://jsonpatch.com

…

just-diff-apply

source

Try it

npm install just-diff-apply
yarn add just-diff-apply

Apply a diff object to an object. Pass converter to apply a http://jsonpatch.com standard patch

…

just-compare

source

Try it

npm install just-compare
yarn add just-compare

Compare two collections

…

just-clone

source

Try it

npm install just-clone
yarn add just-clone

Deep copies objects, arrays, maps and sets

// Deep copies objects and arrays, doesn't clone functions

import clone from 'just-clone';

var arr = [1, 2, 3];
var subObj = { aa: 1 };
var obj = { a: 3, b: 5, c: arr, d: subObj };
var objClone = clone(obj);
arr.push(4);
objClone.d.bb = 2;
obj; // {a: 3, b: 5, c: [1, 2, 3, 4], d: {aa: 1}}
objClone; // {a: 3, b: 5, c: [1, 2, 3], d: {aa: 1, bb: 2}}

just-pluck-it

source

Try it

npm install just-pluck-it
yarn add just-pluck-it

Pluck a property from each member of a collection

import pluck from 'just-pluck-it';

pluck([{a:1, b:2}, {a:4, b:3}, {a:2, b:5}], 'a'); // [1, 4, 2]
pluck({x: {a:1, b:2}, y: {a:4, b:3}, z: {a:2, b:5}}, 'a'); // {x: 1, y: 4, z: 2}

just-flush

source

Try it

npm install just-flush
yarn add just-flush

Returns a copy of an array or object with null/undefined members removed

import flush from 'just-flush';

flush([1, undefined, 2, null, 3, NaN, 0]); // [1, 2, 3, NaN, 0]
flush([true, null, false, true, [null], undefined]); // [true, false, true, [null]]
flush({a: 2, b: null, c: 4, d: undefined}); // {a: 2, c: 4}
flush('something'); // undefined
flush(); // undefined

Objects

just-extend

source

Try it

npm install just-extend
yarn add just-extend

Extend an object

…

just-merge

source

Try it

npm install just-merge
yarn add just-merge

Shallow assign. Like just-extend but without deep copy option.

import merge from 'just-merge';

let obj = {a: 3, b: 5};
merge(obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
obj; // {a: 4, b: 5, c: 8}

let obj = {a: 3, b: 5};
merge({}, obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
obj; // {a: 3, b: 5}

let arr = [1, 2, 3];
let obj = {a: 3, b: 5};
merge(obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
arr.push[4];
obj; // {a: 3, b: 5, c: [1, 2, 3, 4]}

merge({a: 4, b: 5}); // {a: 4, b: 5}
merge(3, {a: 4, b: 5}); // throws
merge({a: 4, b: 5}, 3); // throws
merge({a: 4, b: 5}, {b: 4, c: 5}, 'c'); // throws

just-values

source

Try it

npm install just-values
yarn add just-values

Return property values as an array

const values = require('just-values');

values({a: 4, c: 8}); // [4, 8]
values({a: {aa: 2}, b: {bb: 4}}); // [{aa: 2}, {bb: 4}]
values({}); // []
values([1, 2, 3]); // [1, 2, 3]
values(function(a, b) {return a + b;}); // []
values(new String('hello')); // ['h', 'e', 'l', 'l', 'o']
values(1); // throws exception
values(true); // throws exception
values(undefined); // throws exception
values(null); // throws exception

just-entries

source

Try it

npm install just-entries
yarn add just-entries

Return object entries as an array of [key, value] pairs

import entries from 'just-entries';

// Object:
entries({c: 8, a: 4}); // [['c', 8], ['a', 4]]
entries({b: {bb: 4}, a: {aa: 2}}); // [['b', {bb: 4}], ['a', {aa: 2}]]
entries({}); // []

// Array:
entries([{c: 8}, {a: 4}]); // [[0, {c: 8}], [1, {a: 4}]]
entries(['À', 'mauvais', 'ouvrier', 'point', 'de', 'bon', 'outil'])
// [[0, 'À'], [1, 'mauvais'] ... [6, 'outil']]
entries([]); // []

just-pick

source

Try it

npm install just-pick
yarn add just-pick

Copy an object but with only the specified keys

import pick from 'just-pick';

var obj = { a: 3, b: 5, c: 9 };
pick(obj, ['a', 'c']); // {a: 3, c: 9}
pick(obj, 'a', 'c'); // {a: 3, c: 9}
pick(obj, ['a', 'b', 'd']); // {a: 3, b: 5}
pick(obj, ['a', 'a']); // {a: 3}

just-omit

source

Try it

npm install just-omit
yarn add just-omit

Copy an object but omit the specified keys

import omit from 'just-omit';

var obj = {a: 3, b: 5, c: 9};
omit(obj, ['a', 'c']); // {b: 5}
omit(obj, 'a', 'c'); // {b: 5}
omit(obj, ['a', 'b', 'd']); // {c: 9}
omit(obj, ['a', 'a']); // {b: 5, c: 9}

just-is-empty

source

Try it

npm install just-is-empt

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptdependency-freejavascriptlibrarypwa

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言