Is it any npm option exist to disable postinstall script while installing package? Or for rewriting any field from package.json?
To do this for your own library, I recommend something simple like:
#!/usr/bin/env bash
## this is your postinstall.sh script:
set -e;
if [ "$your_pkg_skip_postinstall" == "yes" ]; then
echo "skipping your package's postinstall routine.";
exit 0;
fi
then do your npm install with:
your_pkg_skip_postinstall="yes" npm install