Skip to content

trimorphdev/deno-depd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DEPD

A lightweight deprecation module for Deno!

Depd is inspired by a Node.js module named Depd.

Usage

import depd from 'https://deno.land/x/depd@1.0.0/mod.ts';

// Create the initial deprecator:
const deprecated = depd('package-name');

// Deprecate a function:
const func = deprecated(function func() {
    console.log('Hello, world!');
});

func();

//=> [WARNING] Package package-name deprecated 'func()'.

If you want to throw an error instead of displaying a warning:

import depd from 'https://deno.land/x/depd@1.0.0/mod.ts';

// Create the initial deprecator:
const deprecated = depd('package-name', {
    error: true // Use configuration
});

// Deprecate a function:
const func = deprecated(function func() {
    console.log('Hello, world!');
});

func();

//=> Error: Package package-name deprecated 'func()'.

About

Deprecate no longer supported features in your library with ease!

Resources

Stars

Watchers

Forks

Packages

No packages published