@fnet/miniconda-installer
v0.1.4
Published
## Introduction
Downloads
35
Readme
@fnet/miniconda-installer
Introduction
The @fnet/miniconda-installer is a utility tool designed to manage the installation, uninstallation, and upgrading of Conda (Miniconda) on your system. It simplifies the process by automatically detecting existing installations and offering suitable options to upgrade or modify your current setup. This cross-platform tool ensures that users can manage Conda installations easily and interactively, making it a helpful tool for users who rely on Conda as part of their development environment.
How It Works
The @fnet/miniconda-installer operates by checking your system for any existing Conda installations and then providing options based on its findings. If Conda is not installed, it guides the installation process, ensuring the correct version and configuration for your platform and architecture. It can also uninstall existing installations or upgrade them to specific versions of Miniconda. The tool interacts with the user for confirmations when needed and can modify system PATH settings to include Conda, if necessary.
Key Features
- Flexible Management: Install, uninstall, or upgrade Conda as required.
- Cross-Platform Support: Works seamlessly on Windows, macOS, and Linux.
- Interactive User Prompts: Provides options and confirmations during operations.
- Automatic PATH Configuration: Offers to add Conda to your PATH if it's not already present.
- Version Control: Specify the version of Miniconda to install or upgrade to.
Conclusion
The @fnet/miniconda-installer is a straightforward and practical tool for managing Conda installations. Whether you're setting up Miniconda for the first time or maintaining an existing setup, this utility helps streamline the process, making it hassle-free and efficient.
@fnet/miniconda-installer Developer Guide
Overview
The @fnet/miniconda-installer
library provides an easy-to-use interface for managing Miniconda installations. Designed to streamline the process of installing, upgrading, and uninstalling Miniconda, it is cross-platform compatible, supporting Windows, macOS, and Linux environments. With this library, developers can automate the setup of Miniconda in their projects and ensure consistent environments across systems.
Installation
To incorporate the @fnet/miniconda-installer
into your Node.js project, you can install it using either npm or yarn. Here are the commands:
With npm:
npm install @fnet/miniconda-installer
With yarn:
yarn add @fnet/miniconda-installer
Usage
The library's main functionality is accessed via a single function, which manages the installation, uninstallation, and upgrading of Miniconda.
Basic Example
Here's a basic usage example for installing Miniconda:
import minicondaInstaller from '@fnet/miniconda-installer';
(async () => {
try {
const condaPath = await minicondaInstaller({
minicondaVersion: 'latest',
action: 'install'
});
console.log(`Conda installed at: ${condaPath}`);
} catch (error) {
console.error(`Error during installation: ${error.message}`);
}
})();
Parameters
minicondaVersion
: Specifies the version of Miniconda to install. Defaults to'latest'
.installDir
: Directory where Miniconda will be installed. Defaults to~/miniconda3
.interactive
: Whether to prompt the user for confirmations. Defaults totrue
.action
: Specifies the operation to perform:'install'
,'uninstall'
, or'upgrade'
. Defaults to'install'
.
Examples
Installing Miniconda
To install Miniconda to a custom directory:
await minicondaInstaller({
minicondaVersion: '23.3.1',
installDir: '/custom/path/to/miniconda',
action: 'install'
});
Uninstalling Miniconda
To uninstall Miniconda from the specified directory:
await minicondaInstaller({
installDir: '/custom/path/to/miniconda',
action: 'uninstall'
});
Upgrading Miniconda
To upgrade an existing Miniconda installation:
await minicondaInstaller({
minicondaVersion: '23.4.0',
action: 'upgrade'
});
Acknowledgement
This library simplifies Miniconda management by leveraging Node.js's built-in modules for cross-platform compatibility.
Input Schema
$schema: https://json-schema.org/draft/2020-12/schema
type: object
properties:
minicondaVersion:
type: string
description: Version of Miniconda to install or upgrade to. Defaults to 'latest'.
default: latest
installDir:
type: string
description: Directory where Miniconda should be installed. Defaults to the
user's home directory.
interactive:
type: boolean
description: Whether to prompt the user for confirmations. Defaults to true.
default: true
action:
type: string
description: "Action to perform: 'install', 'uninstall', or 'upgrade'."
default: install
required: []