New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

delv-task-manager

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

delv-task-manager

test task manager sdk

latest
Source
npmnpm
Version
0.1.7
Version published
Maintainers
1
Created
Source

Delv Task Manager

Delv Task Manager is a simple task management library. You can create, delete, and list tasks. Currently only supports the use of MongoDb

Installation

To install Delv Task Manager, use the following command:

npm install delv-task-manager

How to Use

import { TaskManager, MongoDB } from 'delv-task-manager';

const db = new MongoDB('your-mongodb-uri', 'your-database-name', 'your-collection-name');
const taskManager = new TaskManager(db);

async function main() {
await db.connect();

const success = await taskManager.createTask('Test Task', 'This is a test task');
console.log(`Did the task creation work? ${success}`);

const tasks = await taskManager.listTasks();
console.log('Got all these tasks:', tasks);

await db.disconnect();
}

main();

API

TaskManager

The TaskManager class is the main interface for managing tasks. It supports the following methods:

  • createTask(title: string, description: string): Promise
  • getTask(id: string): Promise<Task | null>
  • deleteTask(id: string): Promise
  • listTasks(): Promise<Task[]>

MongoDB The MongoDB class implements the Database interface for MongoDB. It supports the following methods:

  • connect(): Promise
  • disconnect(): Promise
  • createTask(task: Task): Promise
  • getTask(id: string): Promise<Task | null>
  • deleteTask(id: string): Promise
  • listTasks(): Promise<Task[]>

FAQs

Package last updated on 15 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts