TOAST UI Code Snippet (tui-code-snippet) is a comprehensive collection of modular, lightweight utility methods designed to simplify common JavaScript programming tasks. Currently stable at version 2.3.3, the library maintains a steady release cadence with regular updates including bug fixes and new features, such as the `ajax` module introduced in v2.3.0. A key differentiator since its 2.0 major release is its transition to a fully modular architecture, requiring developers to import individual functions or modules (e.g., `tui-code-snippet/array/inArray`) rather than a monolithic bundle. This approach minimizes bundle sizes by ensuring only the necessary utilities are included in an application. It provides functionalities across various domains including array manipulation, browser detection, collection processing, custom event management, DOM manipulation, class definition, date formatting, inheritance patterns, object utilities, and type checking. It explicitly supports both ES6 module syntax and CommonJS `require` patterns, making it versatile for modern JavaScript development environments. The library is a foundational component within the broader NHN TOAST UI ecosystem.
npm install tui-code-snippetVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing and using several core utility functions like `inArray`, `isString`, `decodeHTMLEntity`, and `extend` for array, type, string, and object manipulation, respectively.
Migrate your project to use npm for package management. Install with `npm install --save tui-code-snippet`.
Update all import statements to target the specific utility function's module path. Refer to the project's GitHub repository for the folder structure to find correct paths.
To create a bundle, use the command `npm run bundle` after installing the package. This will generate the necessary bundled files in your project.
Ensure you are importing individual functions from their specific file paths (e.g., `import inArray from 'tui-code-snippet/array/inArray';`). Do not try to access `tui.array.inArray` or similar patterns.
Verify that `tui-code-snippet` is installed in your `node_modules`. If using a bundler (like Webpack/Rollup), ensure your imports point to the exact module files (e.g., `tui-code-snippet/array/inArray`). Ensure you're not trying to import a non-existent bundle file.
No dependency data recorded yet.