Installing Namespace Wrapper
note
If you are using the task template, the Namespace Wrapper is already installed.
Installation
Install the Namespace Wrapper using your preferred package manager:
# Using NPM
npm install @_koii/namespace-wrapper
# Using Yarn
yarn add @_koii/namespace-wrapper
Importing the Module
- Typescript
- JavaScript
import { namespaceWrapper } from "@_koii/namespace-wrapper";
const { namespaceWrapper } = require("@_koii/namespace-wrapper");
Initialization
The namespace wrapper detects whether it's running locally or in the node and initializes itself accordingly.
Calling Namespace Wrapper Methods
Namespace wrapper methods are called by using the namespace wrapper object like so:
namespaceWrapper.methodName();
For more details on available methods and their usage, refer to the Namespace Wrapper Methods page.
Next Steps
To learn more about specific features, check out these guides:
- Namespace Wrapper Methods - Interact with tasks and the blockchain.
- Environment Variables - Import and use Environment Variables.
- REST APIs - Build HTTP endpoints.
- Database Operations - Learn about data storage.
- File System - Handle files and directories.
- Blockchain/Transaction Operations - Work with blockchain and transaction operations.
- Task Status - Get task state information with namespace methods.
- Network/Task Handling - Manage network data and tasks.
- Audit and Distribution - Manage network data and tasks.