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 🙏

© 2024 – Pkg Stats / Ryan Hefner

hidis

v1.0.5

Published

Hidis is a tool designed for developers who need to keep certain functions and code snippets on their local machines during development without committing or pushing them to remote branches (e.g., production).

Downloads

14

Readme

Why Hidis?

Supports ES6 ✅

Supports JS ✅

Supports Typescript ❌ - coming soon

Supports CJS ✅

Hidis is a tool designed for developers who need to keep certain functions and code snippets on their local machines during development without committing or pushing them to remote branches (e.g., production).

Pre-Hidis Installation:

Hidis relies on pre commit hooks to achieve its goal.

  1. Install Husky: Confirm that you have the husky package installed. If not, you can install it using the following npm command:
npm  i  husky  --save-dev
  1. Setup Husky for Hidis: After installing Husky, run the following commands in your terminal, one after the other - take note of the differences for cjs and es6:

a. General to cjs and es6

npm  pkg  set  scripts.prepare="husky install"

npm  run  prepare

b. 🛑🛑🛑

  • If your project type is ES Module i.e you use import/export, run this 👇:

npx  husky  add  .husky/pre-commit  "node .hidis/precomm.js"
  • If your project type is CJS i.e. you use require(), run this 👇:
npx  husky  add  .husky/pre-commit  "node .hidis/precomm.c.js"

c. General to cjs and es6

git  add  .husky/pre-commit

Hidis Installation:

To install Hidis, run the following command:

npm  install  hidis  --save-dev

Hidis Setup

Hidis creates a folder named (.hidis) inside your root directory.

You need to import this folder only once but in your main /entry point file and in the first line. If not imported at first line then you will get Reference error, it is like you want to use hidis before its birth. 😆

ReferenceError: hidis is not defined

Import hidis like the below inside a file that you are sure would be loaded/required when the node server starts. It is called main entry point file. Your main file could be app.js or index.js. To confirm which file, check your package.json look for the value of main, that value/path leads to the file you are looking for.

Also ensure that the path you provides (import from) correctly points to the .hidis/index.js

**For projects in ES6 **:

import {} from "./.hidis/index.js";

**For projects in Cjs **:

let {} = require("./.hidis/index.c.js");

How does it work?

To use Hidis, start your Nodejs server, call the hidis function anywhere in your project. Hidis takes a string as an argument. Make sure to separate more than one line of code with semicolons. Here's a sample:

hidis(
  'console.log("Everything inside this hidis would not be committed"); let name = "suliyat"; console.log(`My name is not ${name}`)'
);

When you run git commit -m {your commit message} Hidis would hide hidis functions and their arguments from being committed, thus from being pushed.

Ghost Mode - Original Content

Sometimes you still need the hidis functions on your local machine after committing/pushing, so permanently deleting hidis functions at every commit might not present a good dev experience (DX).

To ensure good DX you have the option to choose if you want the hidis functions permanently removed or not. Run the following command to change the config. the default is true (i.e. returns hidis functions back into their places)

npm  run  hidisConfig  --  original [false |  true]

In ghost mode committed files would still appear 'unstaged', as if they have not been committed but they have been! It is just ghosting . . . 😁

Errors

  1. Error: provide arguments: to resolve this error ensure the hidisConfig property in your package.json script is set appropriately - only one command should be there, just like in the sample below.

For this sample, the project is a cjs project - uses require().

"scripts": {

"test": "echo \"Error: no test specified\" && exit 1",

"start": "node index.js",

"dev": "nodemon index.js",

"prepare": "husky install",

"hidisConfig": "node .hidis/config.c.js"

},

Tweet at me https://twitter.com/wahabind