Kyt Utilities (`kyt-utils`) is an internal utility library developed by The New York Times, forming a core component of the `kyt` ecosystem, which is a React starter kit and framework. This package provides specialized helper functions designed for internal use within `kyt`-based applications and the `kyt` build system. Its functionalities include resolving project configurations, managing webpack setup, and handling environment variables and port assignments. The current stable version is 1.3.34. While it doesn't follow an independent public release cadence, it is actively maintained as part of the larger `kyt` mono-repository. Its primary purpose is to support the `kyt` framework, making it distinct from general-purpose utility libraries.
npm install kyt-utilsVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import and utilize core `kyt-utils` functions for tasks such as resolving the project root, loading application configurations, and dynamically finding an available network port for development.
Prefer using `kyt`'s documented APIs where possible. If direct `kyt-utils` imports are necessary, pin exact versions to avoid unexpected breaking changes with minor updates and regularly review the `kyt` monorepo's changelog.
Review the `kyt` monorepo's changelogs around the 1.0.0 release for `kyt-utils` for specific migration steps. Update import paths and function calls to reflect the new package structure and ensure compatibility.
Always check the specific subpath for the utility you intend to import. Refer to the `kyt-utils` source code in the `kyt` GitHub repository for the correct export paths, or inspect the package's `package.json` and build outputs.
Be mindful of where `kyt-utils` is imported. Ensure that utilities relying on `lodash` are only consumed in Node.js environments (e.g., server-side rendering, build scripts) or that your build setup effectively tree-shakes unused `lodash` parts if used in browser bundles. Consider using smaller, purpose-built alternatives if not strictly within a `kyt` server-side context.
Change the import path to a specific subpath where the utility resides, for example: `import { someFunction } from 'kyt-utils/utils';` or `import { anotherFunction } from 'kyt-utils/config';`Verify that you are using named imports (`import { someUtilityFunction } from '...'`) and that the import path precisely matches where the function is exported (e.g., `/utils`, `/webpack`, `/config`). Consult the `kyt-utils` source code for the exact export definitions.Ensure that utilities designed for server-side or build-time execution are only consumed in Node.js environments. If you need similar functionality in the browser, consider implementing browser-compatible alternatives or relying on `kyt`'s client-side runtime for such features.