Installation Guide
F-Box is designed with TypeScript as its primary language, offering robust type safety and developer productivity. While it can be used in plain JavaScript projects, TypeScript is the recommended way to harness its full potential.
Prerequisites
Before you start, ensure your development environment meets the following requirements:
- Node.js: Version 16.8.0 or later.
- npm or yarn: A package manager for JavaScript.
- TypeScript: Version 4.0 or later.
If TypeScript is not already installed in your project, add it with the following command:
npm install typescript --save-dev
Installation Steps
Install the F-Box Package
To install F-Box, run the following command:
# Using npmnpm install f-box-core
# Or using yarnyarn add f-box-core
Start Using F-Box
Here’s an example of using F-Box in TypeScript:
import { Box } from "f-box-core"
const boxA = Box.pack<number>(10)const boxB = boxA["<$>"]((x) => x * 2)console.log(boxA.getValue()) // 10console.log(boxB.getValue()) // 20
What’s Next?
- Key Concepts: Learn about the core abstractions provided by F-Box.
- API Reference: Explore the detailed documentation for
Box
and other modules.
With these steps, you’re ready to start building robust and maintainable applications using F-Box!