
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
quick-license
Advanced tools
quick-license
is a Node.js package that allows you to easily apply, check, and remove license headers from your JavaScript, CSS, and other specified files.
Install the package globally using npm:
npm install -g quick-license
You can use quick-license
through the command line with the following commands:
quick-license test
: Lists the files that will be affected based on your configuration.quick-license license
: Applies the license header to the specified files.quick-license unlicense
: Removes the license header from the specified files.quick-license check: Checks
the license status of the specified files.quick-license check -f <file>
: Checks the license status of a specific file or files (comma-separated).Example usage:
quick-license test
quick-license license
quick-license unLicense
quick-license check
quick-license check -f path/to/file.js
quick-license check --file path/to/file1.js,path/to/file2.css
The configuration for quick-license
can be specified in your package.json
file under the licenseScope
key, or in a separate quickLicense.json
file in the root directory. If neither is found, a default configuration is used.
Example package.json
configuration:
{
"licenseScope": {
"include": ["www/**/*"],
"exclude": ["www/**/test.js", "node_modules/"],
"allowedExtensions": ["js", "css", "mjs", "ts"],
"licenseFile": "license.txt"
}
}
Example quickLicense.json
configuration:
{
"licenseScope": {
"include": ["www/**/*"],
"exclude": ["www/**/test.js", "node_modules/"],
"allowedExtensions": ["js", "css", "mjs", "ts"],
"licenseFile": "license.txt"
}
}
Create a license.txt
file in your project root that contains the license text you want to apply. This text will be added between the predefined license start and end markers.
Example license.txt
:
Your License Text Here
You can also use quick-license
programmatically in your Node.js scripts:
const QuickLicense = require('quick-license');
async function main() {
const config = await QuickLicense.loadConfig();
const quickLicense = new QuickLicense(config);
await quickLicense.test();
await quickLicense.license();
await quickLicense.unLicense();
await quickLicense.check();
await quickLicense.check('path/to/file.js');
}
main().catch(err => console.error(err));`
test()
Traverse and output the list of files that will be affected based on the configuration.
license()
Applies the license header to the specified files.
unLicense()
Removes the license header from the specified files.
check(filepath)
Checks the license status of the specified files. If filepath
is given, it returns the status of that file(s). If no parameter is given, it returns the status of all files.
isLicensed(file)
Checks if the license is applied to the given file.
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
This project is licensed under the MIT License.
FAQs
A tool to apply, remove, and check licenses in .js and .css files.
We found that quick-license demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.