CPL
Install the character-per-line counting tool
npm install rdmkit-cpl --save-dev
This will install CPL as a devDependency.
Quick setup
import cpl from "rdmkit-cpl";
cpl();
This will get you going, but you will have to comment it out or remove it for production builds. Unless, you want it in your build code.
Conditional setup
if (process.env.NODE_ENV === "development") {
var cpl = require("rdmkit-cpl");
cpl();
}
If you are using environment variables, this will only enable CPL while in development. It will not be included in the build. If you happen to use ParcelJS process.env.NODE_ENV === "development"
is set for you on all non-build runs. And it will also set process.env.NODE_ENV === "production"
when you do build. Super handy.
Usage
Select text and get a read-out of the number of characters you have selected. This is helpful if you need to know how many characters are in a line of text. You can also select as much text as you want and it will still tell you how many characters you have selected.
Try it now. Select this text in this line to see what CPL does.