Features
- Proxy access to private NPM registries
- Local caching for improved performance
- Optional logging and database usage
- Configurable through environment variables
Setup
To get started, follow these steps:
- Clone the repository:
git clone https://github.com/muratpolatozkan/pkg-porter.git - Navigate to the project directory:
cd pkg-porter - Install the dependencies:
npm install - Create a
.envfile with the necessary configuration:
# Registry URL and credentials
REGISTRY_URL=https://your-registry-url
USERNAME=your-username
PASSWORD=your-password
# Cache settings
USE_CACHE=true
# Server settings
URL=http://localhost
PORT=8081
# Database usage (set to true if you want to use the database)
USE_DB=true
# Logger usage (set to true if you want to enable logging)
USE_LOGGER=true
npm startUsage
Once the server is running, you can use the proxy server to access packages from your private NPM registry. For example:
http://localhost:8081/@scope/package@version/path/to/file
Replace @scope/package with your package name, version with
the package version, and path/to/file with the path to the specific file you need.