lodash internal createCompounder
raw JSON → 3.0.0 verified Sat Apr 25 auth: no javascript deprecated
An internal lodash utility module that creates a function for combining words using a specified separator and callback. This is part of lodash's modular build system for v3.0.0 only. It is not intended for public use; developers should use the full lodash package or lodash-es instead. The module is deprecated in favor of lodash v4+, which no longer exposes this internal function as a standalone package.
Common errors
error Cannot find module 'lodash._createcompounder' ↓
cause Package version 3.0.0 only; not available in later versions.
fix
Install version 3.0.0: npm install lodash._createcompounder@3.0.0
error TypeError: createCompounder is not a function ↓
cause Incorrect import: requiring the package multiple times or using ESM style.
fix
Use: var createCompounder = require('lodash._createcompounder');
Warnings
deprecated This package is an internal lodash module for v3.0.0 and is deprecated. Do not use in new projects. ↓
fix Use the full lodash package (v4+) or lodash-es for ESM.
breaking lodash v4 removed all internal modular packages like lodash._createcompounder. They are not available in v4. ↓
fix Upgrade to lodash v4 and use public API functions like _.camelCase or _.kebabCase.
gotcha The function exported is not documented in lodash public docs; usage may break without notice. ↓
fix Avoid using internal packages; use lodash public API.
Install
npm install lodash._createcompounder yarn add lodash._createcompounder pnpm add lodash._createcompounder Imports
- createCompounder wrong
import createCompounder from 'lodash._createcompounder';correctvar createCompounder = require('lodash._createcompounder'); - lodash wrong
require('lodash._createcompounder').createCompoundercorrectvar _ = require('lodash'); - camelCase wrong
var camelCase = require('lodash._createcompounder');correctvar camelCase = require('lodash.camelcase');
Quickstart
var createCompounder = require('lodash._createcompounder');
// Example: create a function that joins words with hyphens
var hyphenate = createCompounder(function(result, word, index) {
return result + (index ? '-' : '') + word.toLowerCase();
});
console.log(hyphenate('Hello World')); // 'hello-world'