node-radius-utils is a utility package designed to simplify working with RADIUS protocols in Node.js environments. It provides comprehensive access to FreeRADIUS server dictionary files, including all standard dictionaries like RFC2865, as well as vendor-specific ones like Nokia. The library is currently at version 1.2.0, indicating a stable release without frequent breaking changes. It offers typed locations for dictionary files, typed attributes, and typed values, significantly enhancing the developer experience, especially for TypeScript users. A key feature is the `attributesToArray` utility function, which facilitates converting a plain JavaScript object of RADIUS attributes into the specific array-of-arrays format required by libraries such as `node-radius`. While no explicit release cadence is documented, typical open-source practices suggest bug fixes via patch versions and new features via minor versions. Its primary differentiator is the pre-packaged and highly typed dictionary definitions, saving developers from the laborious task of manually parsing or maintaining these complex configuration files. It is explicitly designed to be used as a companion to a full-fledged RADIUS protocol implementation like `node-radius`, rather than being a standalone client or server.
npm install node-radius-utilsVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing dictionary files and the `attributesToArray` utility, then using them with the `radius` library to encode a RADIUS Access-Request packet with various attributes.
Ensure you install and configure a RADIUS protocol implementation like `npm i radius` alongside `node-radius-utils`.
Verify that your module bundler (e.g., Webpack, Rollup, Parcel) is configured to correctly resolve Node.js module paths for dynamically loaded files, or consider manually passing file paths if bundling fails.
Always refer to the typed exports (e.g., `rfc2865.attributes.NAS_IP_ADDRESS`) or the library's documentation for the correct casing and availability of attributes and values. TypeScript users will benefit from autocomplete and type checking for these exports.
When upgrading to a new major version, always carefully review the changelog and any migration guides for breaking changes related to dictionary access or utility function usage.
Ensure `npm install radius` has been run and that the `radius` object is correctly imported and available at runtime. Verify compatibility between `node-radius` and `node-radius-utils` versions.
Verify the dictionary name you are trying to access (e.g., `rfc2865`, `nokia`, `freeradius_internal`) is a valid and correctly spelled export from `node-radius-utils.dictionaries` and that it was properly destructured.
Ensure all necessary dictionary files (e.g., `nokia.file`) have been added to the `radius` library using `radius.add_dictionary()`. Also, verify the attribute key used in `attributesToArray` (e.g., `nokia.attributes.NOKIA_SERVICE_NAME`) correctly maps to an attribute defined in the loaded dictionaries and is case-sensitive.