{"id":27563,"library":"yummies","title":"yummies","description":"yummies is a collection of frontend utilities for JavaScript/TypeScript projects, currently at v7.19.4. It provides a wide range of functions for common tasks including DOM manipulation, data structures, type guards, React hooks, MobX integrations, and more. The library is actively maintained with frequent releases (multiple patches/minors per month). Its key differentiator is the breadth of utilities under a single package, covering areas like async templates (asyncTemplate), class variance authority (cva), and MobX annotations (annotation), all with TypeScript support. The package requires MobX and React as peer dependencies.","status":"active","version":"7.19.4","language":"javascript","source_language":"en","source_url":"git://github.com/js2me/yummies","tags":["javascript","typescript","utilities"],"install":[{"cmd":"npm install yummies","lang":"bash","label":"npm"},{"cmd":"yarn add yummies","lang":"bash","label":"yarn"},{"cmd":"pnpm add yummies","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for MobX-related utilities such as annotation.","package":"mobx","optional":false},{"reason":"Required for React-related utilities (hooks, etc.).","package":"react","optional":false}],"imports":[{"note":"ESM-only package; CommonJS require may fail or require specific import syntax. Use ESM imports.","wrong":"const { asyncTemplate } = require('yummies')","symbol":"asyncTemplate","correct":"import { asyncTemplate } from 'yummies'"},{"note":"cva is a named export, not a default export.","wrong":"import cva from 'yummies'","symbol":"cva","correct":"import { cva } from 'yummies'"},{"note":"annotation is exported from the main entry point, not a subpath. No need for 'yummies/mobx'.","wrong":"import { annotation } from 'yummies/mobx'","symbol":"annotation","correct":"import { annotation } from 'yummies'"},{"note":"hasEnumerableKeys is exported from the 'yummies/data' subpath, not the main entry.","wrong":"import { hasEnumerableKeys } from 'yummies'","symbol":"hasEnumerableKeys","correct":"import { hasEnumerableKeys } from 'yummies/data'"},{"note":"assert is a named export, not a default export. ES module syntax required.","wrong":"import assert from 'yummies'","symbol":"assert","correct":"import { assert } from 'yummies'"}],"quickstart":{"code":"import { asyncTemplate, cva, annotation, hasEnumerableKeys, assert } from 'yummies';\nimport { observable } from 'mobx';\n\n// asyncTemplate: interpolate promises and functions\nconst result = await asyncTemplate`Hello ${async () => 'world'}!`;\nconsole.log(result); // 'Hello world!'\n\n// cva: class variance authority\nconst button = cva(['base', 'btn'], {\n  variants: {\n    size: {\n      small: ['text-sm'],\n      large: ['text-lg']\n    },\n    intent: {\n      primary: ['bg-blue-500'],\n      secondary: ['bg-gray-500']\n    }\n  }\n});\nconst classes = button({ size: 'small', intent: 'primary' });\nconsole.log(classes); // 'base btn text-sm bg-blue-500'\n\n// annotation: MobX annotation helper\nconst annotate = annotation({\n  prop1: observable,\n  prop2: observable\n});\nconsole.log(annotate); // object with MobX decorators\n\n// hasEnumerableKeys: check own enumerable keys\nconst obj = { a: 1, b: 2 };\nconsole.log(hasEnumerableKeys(obj, ['a', 'b'])); // true\n\n// assert: type guard with error\nassert.array([1, 2, 3], 'Must be array'); // passes\nassert.object(42, 'Must be object'); // throws 'Must be object'","lang":"typescript","description":"Demonstrates importing and using asyncTemplate, cva, annotation, hasEnumerableKeys, and assert from yummies."},"warnings":[{"fix":"Replace imports: 'yummies/utility-types' -> 'yummies/types.global', 'yummies/utils/types' -> 'yummies/types'.","message":"Imports from 'yummies/utility-types' and 'yummies/utils/types' are removed in v6. Use 'yummies/types.global' and 'yummies/types' respectively.","severity":"breaking","affected_versions":">=6.0.0 <6.0.0"},{"fix":"Use correct subpath import: import { hasEnumerableKeys } from 'yummies/data'.","message":"Some utilities like hasEnumerableKeys are exported from subpaths (e.g., 'yummies/data'), not the main entry. Importing from 'yummies' will not include them.","severity":"gotcha","affected_versions":">=7.18.0"},{"fix":"Use ES module imports (import/export syntax) or configure your environment for ESM (e.g., \"type\": \"module\" in package.json).","message":"The package is ESM-only. Using require() may fail entirely or require specific bundler configuration.","severity":"gotcha","affected_versions":">=7.0.0"},{"fix":"See breaking change for v6 migration.","message":"The 'yummies/utility-types' and 'yummies/utils/types' subpaths are deprecated and removed in v6.","severity":"deprecated","affected_versions":">=5.0.0 <6.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use dynamic import: const { asyncTemplate } = await import('yummies'); or switch to ESM imports.","cause":"Trying to use require() to import yummies, which is ESM-only.","error":"ERR_REQUIRE_ESM: require() of ES Module not supported"},{"fix":"Change import to: import { hasEnumerableKeys } from 'yummies/data'.","cause":"Importing from 'yummies' instead of the subpath 'yummies/data'.","error":"Module 'yummies' does not export 'hasEnumerableKeys'"},{"fix":"Replace with 'yummies/types.global' and 'yummies/types' respectively.","cause":"Imports from removed paths after v6 migration.","error":"Cannot find module 'yummies/utility-types' or 'yummies/utils/types'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}