My first NPM package that you probably don’t need

Ali Ataf
1 min readJun 4, 2021

--

I just published my first NPM package which has the name log but scoped to my username so it would be @aliataf/log because it is easier to find the needle in a haystack than to find a package name that is not taken on NPM.😅

So what is this package?

Fast way to destinct your variables logged

If you are a positive lazy person like me, and what I mean by positive is that your laziness is to save time, then this package might help you a little.

I always find myself writing console.log statements with the name of the variable especially when the console has so many messages for example:

let language = 'Javascript';
console.log('language', language);

To output something like: language Javascript

So what this package does is logs the name of the variable automatically.

This package follows semantic versioning and it is currently at version 0.4.3

Installation

npm i --save-dev @aliataf/log

Usage

import log from '@aliataf/log';

const firstName = 'Ali';
const lastName = 'Ataf';
const language = 'Javascript';

log({ language });
/* =>
language = Javascript
*/

log({ firstName, lastName });

/* =>
firstName = Ali
lastName = Ataf
*/

Of course, you need a dev tool to be able to use import or require like Webpack or Browserify .

And that’s it if you have any improvement or issue please don’t hesitate to share.

Github link

NPM link

--

--

Ali Ataf
Ali Ataf

No responses yet