npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

duckerdbg

v1.0.1

Published

Simple console debugger for simple applications

Downloads

11

Readme

🏠 Homepage

Installation

npm i duckerdbg --save

Usage

Ducker Debug can perform multiple debugging and utility functions. To use it in your application you just need to require it.

  const ducker = require('./index')

quack()

Base function of this package, it logs a message to the console by either using a custom word or by leaving it empty, by printing the name of the calling function.

Arguments

Use

  ducker.quack()
  // 🦆 {Quack} > 

  ducker.quack('wow',true,3)
//   🦆 {Quack} > wow
// ┌─────────┬────────────────────────────────────────┬──────────────────────┬────────┬──────┐
// │ (index) │                fileName                │     functionName     │ column │ line │
// ├─────────┼────────────────────────────────────────┼──────────────────────┼────────┼──────┤
// │    0    │ '/Users/xxxx/Projects/ducker/index.js' │     'printStack'     │   32   │  54  │
// │    1    │ '/Users/xxxx/Projects/ducker/index.js' │    'Object.quack'    │   9    │  43  │
// │    2    │ '/Users/xxxx/Projects/ducker/test.js'  │ 'Object.<anonymous>' │   8    │  25  │
// └─────────┴────────────────────────────────────────┴──────────────────────┴────────┴──────┘

check()

This method gives a detailed look at any object that is passed to it.

Arguments

Use

  ducker.check(4)
  /**
   * This value is of type number
      -> Its value is 4
   */

   ducker.check([1,2,['wow',true,[{'a' : 2}]]])
   /*
   This value is of type object
  -> Array type 
  Arr[0]
    This value is of type number
      -> Its value is 1
  Arr[1]
    This value is of type number
      -> Its value is 2
  Arr[2]
    This value is of type object
      -> Array type 
      Arr[0]
        This value is of type string
          -> Its value is wow
      Arr[1]
        This value is of type boolean
          -> Its value is true
      Arr[2]
        This value is of type object
          -> Array type 
          Arr[0]
            This value is of type object
              ┌─────────┬─────┬───────┬──────────┐
              │ (index) │ Key │ Value │   Type   │
              ├─────────┼─────┼───────┼──────────┤
              │    0    │ 'a' │   2   │ 'number' │
              └─────────┴─────┴───────┴──────────┘
  */
   

go() and stop()

These methods are used to profile an application. All is needed from them is to be placed at any point between two blocks of code.

Use

  ducker.go()
  ducker.check([1,2,['wow',true,[{'a' : 2}]]])
  ducker.stop()
  /*
  ...
  🦆 {Quack}: 6.111ms
  */

test()

This method allows you to make simple tests on sync or async code using an equality assertion. (Expected value is equal to Actual value)

Arguments

Usage

  function sum (a,b) {
    return a + b
  }

  ducker.test(sum,[2,2],4)
  /*
  🦆 {Quack}
  Function name: sum
    --Result
    Function Result: 4
    Expected Result: 4
    Test successful!
  */

 ducker.test(sum,[2,2],2)
 /*
  🦆 {Quack}
  Function name: sum
    --Result
    Function Result: 4
    Expected Result: 2
    Test failed!
 */

rename()

This method allows you to rename an object's keynames. You only need to pass down the method and an object specifying the new name of the keys.

Arguments

Returns

A new object with the same values for the changed keynames.

Usage

  const user = { 'name' : 'Johny', 'age': 23}
  const changes = {'name': 'firstName'}
  ducker.rename(user,changes)
  // {'firstName' : 'Johny', 'age' : 23}

xray()

This method allows you to analyze an object. Fit for the console.table() function to be better analyzed.

Arguments

Usage

  console.log(ducker.xray({ 'name' : 'Johny', 'age': 23}))
  /*
  [ { Key: 'name', Value: 'Johny', Type: 'string' },
  { Key: 'age', Value: 23, Type: 'number' } ]
  */

 console.table(ducker.xray({ 'name' : 'Johny', 'age': 23}))
/*
┌─────────┬────────┬─────────┬──────────┐
│ (index) │  Key   │  Value  │   Type   │
├─────────┼────────┼─────────┼──────────┤
│    0    │ 'name' │ 'Johny' │ 'string' │
│    1    │ 'age'  │   23    │ 'number' │
└─────────┴────────┴─────────┴──────────┘
*/

random()

This method returns a random number.

Arguments

Usage

  ducker.random()
  // 8874205820570765

  ducker.random(true,4,10)
  // 5.868581947768592

fake()

This method creates an object with fake data based on an user provided schema.

Arguments

This method only retrieves a schema as an object and can recognize multiple data types such as:

Usage

  ducker.fake({
    name: 'name',
    email: 'email',
    username: 'username',
    email: 'email',
    sentence: 'sentence',
    paragraphs: 'paragraphs',
    bloodT: 'blood',
    color: 'color',
    person : {
         name : 'name',
         age: 'age',
    }
})
/*
{ name: 'Beryl',
  email: '[email protected]',
  username: 'Beryl61',
  sentence: 'Aut voluptatum sit qui minus nam.',
  paragraphs:
   'Dolores aut dolorum consequatur. Sunt praesentium quam voluptatibus harum voluptas. Aut debitis cupiditate a explicabo quae earum.\n \rSit aperiam assumenda veniam sit tenetur et ad odio odit. Quia at commodi odio voluptatum. Voluptatem est ratione. Nam repellendus dicta magni ipsam quasi ut nesciunt. Tempora consectetur cum ipsum consequatur inventore. Voluptas consequatur nulla dolorum est tempore excepturi.\n \rDolore et aut eos ut nisi aliquid qui aut. Voluptatem optio possimus sed deleniti consequatur qui odit. Corporis qui qui inventore saepe id doloremque. Repellat consectetur accusantium magnam repellendus praesentium. Assumenda dignissimos consequatur nemo exercitationem minima. Illo maxime enim placeat voluptas maxime ad voluptatibus doloremque hic.',
  bloodT: { type: 'O', rh: '-' },
  color: 'lime',
  person: { name: 'Dale', age: 48 } }
  */

stackoverflow()

This method takes an error message and creates an usable link to search for it on Stack Overflow.

Arguments

Usage

  try {
      JSON.parse({"foo": 1,})
  } catch(e){
      console.log(e)
      ducker.stackoverflow(e)
  }
  /*
  🦆 {Quack}
  Check on SO for Error > Unexpected token o in JSON at position 1
  http://stackoverflow.com/search?q=[js]+unexpected+token+o+in+json+at+position+1
  */

searchable()

This method takes a simple sentence and converts it into an usable string to search on a web browser.

Arguments

Usage

  ducker.searchable('Another one biTEs tHe duST','youtube')
  // https://www.youtube.com/results?search_query=another+one+bites+the+dust

Author

👤 Fernando Martin Garcia Del Angel

🤝 Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2019 Fernando Martin Garcia Del Angel. This project is Apache-2.0 licensed.


This README was generated with ❤️ by readme-md-generator