{"id":48410,"library":"lodash.rest","title":"lodash.rest","description":"This package provides the `_.rest` method from lodash as a standalone, modularized module (v4.0.5). It creates a function that invokes the provided function with arguments from the second argument onward, effectively ignoring the first argument. It is part of the lodash modularized approach, allowing users to cherry-pick individual methods without importing the full lodash library. Useful for functional programming patterns such as transforming callback arguments. Current stable version: 4.0.5. Release cadence is tied to lodash core releases. Key differentiator: zero dependencies, targeting Node.js and bundlers.","status":"active","version":"4.0.5","language":"javascript","source_language":"en","source_url":"https://github.com/lodash/lodash","tags":["javascript","lodash-modularized","rest"],"install":[{"cmd":"npm install lodash.rest","lang":"bash","label":"npm"},{"cmd":"yarn add lodash.rest","lang":"bash","label":"yarn"},{"cmd":"pnpm add lodash.rest","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package uses CommonJS. ESM import may fail in some environments; use require() in Node.js.","wrong":"import rest from 'lodash.rest';","symbol":"rest","correct":"var rest = require('lodash.rest');"},{"note":"ESM import works in bundlers and Node.js with 'type': 'module' or .mjs ext.","wrong":null,"symbol":"rest","correct":"import rest from 'lodash.rest';"},{"note":"This package exports a single function, not an object with a 'rest' property. Destructuring will result in undefined.","wrong":"const { rest } = require('lodash.rest');","symbol":"rest","correct":"const rest = require('lodash.rest');"}],"quickstart":{"code":"var rest = require('lodash.rest');\nvar say = function(greeting, name) {\n  return greeting + ' ' + name;\n};\nvar sayRest = rest(say);\nconsole.log(sayRest('Hello', 'World')); // => 'Hello World'\nconsole.log(sayRest('Hello', 'World', '!')); // => 'Hello World' (note: rest ignores first arg, but say only expects two)","lang":"javascript","description":"Demonstrates creating a rest function that ignores the first argument and passes the rest to the original function."},"warnings":[{"fix":"Use require('lodash.rest') directly, not destructuring like { rest }.","message":"The package exports a function, not an object with a 'rest' property.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Import each needed method separately (e.g., lodash.map, lodash.filter) or use the full lodash package.","message":"lodash.rest does not include the full lodash library; ensure you are aware that other lodash methods are not available.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Consider using lodash@4 or lodash-es imports: import rest from 'lodash/rest';","message":"Modularized lodash packages are considered legacy; functionality is available in lodash@4.x under the main package.","severity":"deprecated","affected_versions":">=4.0.0"}],"env_vars":null,"search_vec":"'4.0.5':72 'allow':45 'approach':44 'argument':26,30,36,68 'bundler':88 'cadenc':74 'callback':67 'cherri':49 'cherry-pick':48 'core':79 'creat':17 'current':69 'depend':84 'differenti':82 'effect':32 'first':35 'full':56 'function':19,24,61 'ignor':33 'import':54 'individu':51 'invok':21 'javascript':89 'key':81 'librari':58 'lodash':9,42,57,78,91 'lodash-modular':90 'lodash.rest':1 'method':7,52 'modul':14 'modular':13,43,92 'node.js':86 'onward':31 'packag':3 'part':39 'pattern':63 'pick':50 'program':62 'provid':4,23 'releas':73,80 'rest':6,93 'second':29 'stabl':70 'standalon':12 'target':85 'tie':76 'transform':66 'use':59 'user':46 'v4.0.5':15 'version':71 'without':53 'zero':83","created_at":"2026-06-07T16:56:31.329741+00:00","updated_at":"2026-06-07T16:56:31.329741+00:00","problems":[{"fix":"Run 'npm install lodash.rest' in your project directory.","cause":"Module is not installed or npm install failed due to missing dependencies or network issues.","error":"Cannot find module 'lodash.rest'"},{"fix":"Change to 'var rest = require('lodash.rest');' and call rest(yourFunction).","cause":"Importing the package incorrectly (e.g., destructuring).","error":"TypeError: require(...) is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://lodash.com/","github":"https://github.com/lodash/lodash","docs":null,"changelog":null,"pypi":null,"npm":"lodash.rest","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}