
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
jsite-utils
Advanced tools
Name | Purpose |
---|---|
.eslintrc.json | ESLint configuration |
.gitignore | Git ignore |
.npmignore | NPM ignore |
package.json | NPM package |
tsconfig.json | TypeScript configuration |
node.js.yml | GitHub Action: test on commit/pull request |
npm-publish.yml | GitHub Action: NPM & GitHub publish on release |
clean.ts | Utility to selectively clean /dist/src/ |
/lib/ | Helpers often used in my projects |
/interfaces/ | Interfaces often used in my projects |
ESLint configuration is used to maintain code quality, readability, and uniformity - across browser-based JavaScript, Node.js, and TypeScript.
TypeScript configuration establishes the directory structure and compile rules.
...because TypeScript does not clean up older compiled files, clean.ts is used (see below).
The current TypeScript configuration will produce:
Git ignore controls which files are sent to Bitbucket/GitHub,
Should include only the minimum number of files needed to reproduce development and testing.
Note: There is not a blanket ignore on /dist/src, the "git" script must be used.
NPM ignore controls which files are sent to NPM,
Should include only the minimum number of files needed to utilise the package.
Tests are ignored, as end-users don't need these - contributors can get them from Git.
Establishes "main" as "./dist/src/index" instead of "main.js".
Sets up three scripts:
Before require/importing in another script, "build" must have been run.
Before committing to the Git repository, "git" must have been run.
Using npm init will update this with other NPM properties.
If a commit/pull request is made onto the "master" branch, the "test" script is run.
If a release is made through the GitHub repository, the package is published to both NPM and GitHub packages. Requires the NPM_TOKEN secret to be setup in the repository.
If you make an "example.ts" file and compile it, an "example.js" file is produced, if you later decide you don't need "example.ts" and delete it - the "example.js" file (and .js.map, .d.ts, .d.ts.map files) remains in the repository.
This usually isn't a massive deal, perhaps some wasted size on the NPM package until you notice and delete it, but if you're using functions that read directories (even if these functions aren't in your code - they are in Mocha) then these zombie files could cause problems.
clean.ts recursively selectively deletes everything inside of /dist/src/ that looks like a compiled JS file - either on request, or when tests are run - this ensures a clean working directory.
FAQs
Utility module for the JSite package
We found that jsite-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.