Socket
Socket
Sign inDemoInstall

add-dist-header

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

add-dist-header - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

19

bin/cli.js

@@ -21,2 +21,3 @@ #!/usr/bin/env node

// $ npm install
// $ npm test
// $ node bin/cli.js "spec/fixtures/source" "spec/fixtures/target"

@@ -40,11 +41,11 @@ // $ node bin/cli.js --no-version

// Prepend
const normalize = (name) => path.normalize(name.endsWith(path.sep) ? name.slice(0, -1) : name);
const origin = normalize(source);
const targetRoot = normalize(target);
const isFolder = fs.existsSync(origin) && fs.statSync(origin).isDirectory();
const wildcard = cli.flagOn.recursive ? '/**/*' : '/*';
const pattern = slash(isFolder ? origin + wildcard : origin);
const extensions = cli.flagMap.ext?.split(',') ?? null;
const keep = (filename) => !extensions || extensions.includes(path.extname(filename));
const filenames = globSync(pattern, { nodir: true }).filter(keep).sort();
const normalize = (name) => path.normalize(name.endsWith(path.sep) ? name.slice(0, -1) : name);
const origin = normalize(source);
const targetRoot = normalize(target);
const isFolder = fs.existsSync(origin) && fs.statSync(origin).isDirectory();
const wildcard = cli.flagOn.recursive ? '/**/*' : '/*';
const pattern = slash(isFolder ? origin + wildcard : origin);
const extensions = cli.flagMap.ext?.split(',') ?? null;
const keep = (filename) => !extensions || extensions.includes(path.extname(filename));
const filenames = globSync(pattern, { nodir: true }).filter(keep).sort();
const error =

@@ -51,0 +52,0 @@ cli.invalidFlag ? cli.invalidFlagMsg :

@@ -1,2 +0,2 @@

//! add-dist-header v1.3.2 ~~ https://github.com/center-key/add-dist-header ~~ MIT License
//! add-dist-header v1.3.3 ~~ https://github.com/center-key/add-dist-header ~~ MIT License

@@ -3,0 +3,0 @@ export type Settings = {

@@ -1,2 +0,2 @@

//! add-dist-header v1.3.2 ~~ https://github.com/center-key/add-dist-header ~~ MIT License
//! add-dist-header v1.3.3 ~~ https://github.com/center-key/add-dist-header ~~ MIT License

@@ -73,3 +73,3 @@ import { isBinary } from 'istextorbinary';

header: isTextFile ? header : null,
source: filename,
source: slash(filename),
file: outputPath,

@@ -76,0 +76,0 @@ length: isTextFile ? final.length : null,

{
"name": "add-dist-header",
"version": "1.3.2",
"version": "1.3.3",
"description": "Prepend a one-line banner comment (with license notice) to distribution files",

@@ -77,10 +77,13 @@ "license": "MIT",

"eslint --max-warnings 0 . --ext .ts",
"tsc",
"tsc"
],
"dist": [
"copy-file build/add-dist-header.js --folder dist",
"node bin/cli.js --no-version build dist"
"node bin/cli.js --no-version build dist",
"html-validator spec"
]
},
"scripts": {
"pretest": "run-scripts clean build",
"test": "mocha spec/*.spec.js && w3c-html-validator"
"pretest": "run-scripts clean build dist",
"test": "mocha spec/*.spec.js"
},

@@ -91,4 +94,4 @@ "dependencies": {

"fancy-log": "~2.0",
"glob": "10.3.6",
"istextorbinary": "~6.0",
"glob": "~10.3",
"istextorbinary": "~7.0",
"make-dir": "~4.0",

@@ -100,9 +103,9 @@ "slash": "~5.1"

"@types/glob": "~8.1",
"@types/node": "~20.6",
"@typescript-eslint/eslint-plugin": "~6.7",
"@typescript-eslint/parser": "~6.7",
"@types/node": "~20.9",
"@typescript-eslint/eslint-plugin": "~6.10",
"@typescript-eslint/parser": "~6.10",
"assert-deep-strict-equal": "~1.1",
"copy-file-util": "~1.1",
"copy-folder-util": "~1.1",
"eslint": "~8.50",
"eslint": "~8.53",
"jshint": "~2.13",

@@ -113,4 +116,4 @@ "mocha": "~10.2",

"typescript": "~5.2",
"w3c-html-validator": "~1.5"
"w3c-html-validator": "~1.6"
}
}

@@ -107,5 +107,10 @@ # Add Dist Header

- `add-dist-header build dist --no-version '--delimiter= --- '`<br>
Specify a delimiter with a leading and trailing space.
- `add-dist-header build dist --ext=.js,.css --recursive`<br>
Process only JavaScript and CSS files in the **build** folder and its subfolders.
_**Note:** Single quotes in commands are normalized so they work cross-platform and avoid the errors often encountered on Microsoft Windows._
## C) Application Code

@@ -112,0 +117,0 @@ Even though **add-dist-header** is primarily intended for build scripts, the package can be used programmatically in ESM and TypeScript projects.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc