ms-rest is a foundational client runtime for Node.js client libraries generated using AutoRest, specifically designed for interacting with Azure services. It provides core infrastructure for serialization, deserialization, error handling, tracing, and configuring HTTP client pipelines. The current stable version is 2.5.6, with its last publish in May 2022. While it was a cornerstone of the older Azure SDK for Node.js, this package and its containing repository (`azure-sdk-for-node`) are now officially deprecated. Newer Azure SDKs (`@azure/*`) leverage more modular core packages like `@azure/core-http` and `@azure/core-rest-pipeline` for improved performance and maintainability. ms-rest ships with built-in TypeScript type definitions and adheres to Microsoft REST API Guidelines for consistent API design and error handling, differentiating it by its specific use within the Azure ecosystem for AutoRest-generated clients.
npm install ms-restVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic object serialization and deserialization using `ms-rest` mappers, including handling required properties during validation.
Migrate to the equivalent services and functionalities provided by the modern `@azure/*` packages. For authentication, use `@azure/identity`. For HTTP pipeline, refer to `@azure/core-rest-pipeline` and `@azure/core-http`.
Carefully review the changelog for specific breaking changes if upgrading within the 2.x range, particularly for HTTP client behavior or request cancellation. Consider migrating to the modern `@azure/core-http` or `@azure/core-rest-pipeline` for up-to-date and consistent HTTP client abstractions.
Replace legacy authentication code that leverages `ms-rest-azure` or `@azure/ms-rest-nodeauth` with credential types and methods provided by `@azure/identity`.
Ensure consistent module syntax within your project. If using `ms-rest` in a modern ESM project, dynamic `import()` might be required, or configure your build system to correctly transpile/bundle CommonJS modules for ESM consumption. Consider `"type": "module"` in `package.json` for ESM projects or using `.cjs` for CommonJS files within an ESM project.
Import authentication methods from `ms-rest-azure` or `@azure/ms-rest-nodeauth`. For modern applications, migrate to `@azure/identity`. Example: `const msRestAzure = require('ms-rest-azure'); msRestAzure.loginWithServicePrincipalSecret(...)` or `import { DefaultAzureCredential } from '@azure/identity';`If consuming `ms-rest` from an ESM context, you may need to use dynamic `import('ms-rest')` or ensure your build system handles CommonJS interoperability. If `ms-rest` is requiring another package that is now ESM-only, you might need to find a CommonJS-compatible version of that dependency or upgrade `ms-rest` if a newer, ESM-compatible version exists (though `ms-rest` itself is deprecated).Ensure that all properties marked `required: true` in your mapper definitions are present in the JavaScript/TypeScript object you are serializing or deserializing. Check the input object and your mapper definition for consistency.
No dependency data recorded yet.