0.0.1 • Published 3 months ago
central-error-codes v0.0.1
Sure! Here’s the updated README in Markdown format:
# Centralized Error Codes
## Overview
This repository provides a centralized collection of error codes that can be used across multiple microservices. It is designed to standardize error handling for both Node.js and Python-based applications.
## Publishing a New Node Module
Follow these steps to publish a new version of the module:
1. Install dependencies:
```bash
npm i --save-dev @types/node
- Build the project:
npm run build
- Package the module:
npm pack
- Publish the package to npm (ensure you are logged in):
If not logged in, run:npm publish --access public
npm login
Installation
To use this package in a Node.js application, install it via npm:
npm install central-error-codes
Usage in Node.js
Import and use the error codes in your application:
import { ErrorCode } from "central-error-codes";
const ALL_ERROR_CODE = ErrorCode.getAllErrors();
const CMS_ERROR_CODE = ErrorCode.getCMSGatewayError();
Usage in Python
For Python-based applications, usage instructions will be provided in a future update.
Publishing a New Version for Python
To publish a new version of this package to PyPI, follow these steps:
- Install the required tools:
pip install setuptools wheel twine
- Build the distribution files:
or alternatively:python3 setup.py sdist bdist_wheel
python3 -m build
- Upload the package to PyPI using Twine:
twine upload $(find dist -type f -not -path "dist/typescript/*")