Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

browserify-banner

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browserify-banner - npm Package Compare versions

Comparing version 1.0.11 to 1.0.12

44

lib/index.js

@@ -1,11 +0,11 @@

'use strict';
"use strict";
const _ = require('lodash');
const fs = require('fs');
const ono = require('ono');
const path = require('path');
const moment = require('moment');
const through = require('through2');
const convertSourcemap = require('convert-source-map');
const offsetSourcemap = require('offset-sourcemap-lines');
const _ = require("lodash");
const fs = require("fs");
const ono = require("ono");
const path = require("path");
const moment = require("moment");
const through = require("through2");
const convertSourcemap = require("convert-source-map");
const offsetSourcemap = require("offset-sourcemap-lines");

@@ -23,3 +23,3 @@ module.exports = browserifyBanner;

if (typeof browserify === 'string') {
if (typeof browserify === "string") {
// browserify-banner was loaded as a transform, not a plug-in.

@@ -30,6 +30,6 @@ // So return a stream that does nothing.

browserify.on('package', setPackageOption);
browserify.on('file', setFileOption);
browserify.on('bundle', wrapBundle);
browserify.on('reset', wrapBundle);
browserify.on("package", setPackageOption);
browserify.on("file", setFileOption);
browserify.on("bundle", wrapBundle);
browserify.on("reset", wrapBundle);

@@ -55,3 +55,3 @@ /**

if (!options.file) {
options.file = path.join(path.dirname(file), 'banner.txt');
options.file = path.join(path.dirname(file), "banner.txt");
}

@@ -64,3 +64,3 @@ }

function wrapBundle () {
let wrap = browserify.pipeline.get('wrap');
let wrap = browserify.pipeline.get("wrap");
let bannerAlreadyAdded = false;

@@ -100,7 +100,7 @@ let banner;

// Get the sourcemap, once it exists
let conv = convertSourcemap.fromSource(chunk.toString('utf8'));
let conv = convertSourcemap.fromSource(chunk.toString("utf8"));
if (conv) {
// Offset the sourcemap by the number of lines in the banner
let offsetMap = offsetSourcemap(conv.toObject(), countLines(banner));
this.push(new Buffer('\n' + convertSourcemap.fromObject(offsetMap).toComment() + '\n'));
this.push(new Buffer("\n" + convertSourcemap.fromObject(offsetMap).toComment() + "\n"));
pushed = true;

@@ -133,3 +133,3 @@ }

if (!options.banner) {
if (typeof options.pkg === 'string') {
if (typeof options.pkg === "string") {
// Read the package.json file

@@ -150,3 +150,3 @@ options.pkg = readJSON(options.pkg);

if (!/^\s*(\/\/|\/\*)/.test(options.banner)) {
options.banner = '/*!\n * ' + options.banner.trim().replace(/\n/g, '\n * ') + '\n */\n';
options.banner = "/*!\n * " + options.banner.trim().replace(/\n/g, "\n * ") + "\n */\n";
}

@@ -166,3 +166,3 @@ }

function readJSON (filePath) {
let json = fs.readFileSync(filePath, 'utf8');
let json = fs.readFileSync(filePath, "utf8");

@@ -186,3 +186,3 @@ try {

try {
return fs.readFileSync(startingPath, 'utf8');
return fs.readFileSync(startingPath, "utf8");
}

@@ -189,0 +189,0 @@ catch (e) {

{
"name": "browserify-banner",
"version": "1.0.11",
"version": "1.0.12",
"description": "Add a comment (and/or code) to the top of your Browserify bundle",

@@ -21,3 +21,3 @@ "keywords": [

"license": "MIT",
"homepage": "https://github.com/JS-DevTools/browserify-banner",
"homepage": "https://jsdevtools.org/browserify-banner",
"repository": {

@@ -32,3 +32,3 @@ "type": "git",

"scripts": {
"lint": "eslint lib test/fixtures test/specs --fix",
"lint": "eslint lib test/fixtures test/specs",
"test": "mocha && npm run lint",

@@ -43,6 +43,6 @@ "coverage": "nyc --reporter=text --reporter=lcov mocha",

"chai": "^4.2.0",
"codacy-coverage": "^3.1.0",
"codacy-coverage": "^3.3.0",
"coveralls": "^3.0.2",
"eslint": "^5.6.1",
"eslint-config-modular": "^4.2.1",
"eslint": "^5.9.0",
"eslint-config-modular": "^5.0.0",
"exorcist": "^1.0.1",

@@ -52,6 +52,6 @@ "mkdirp": "^0.5.1",

"npm-check": "^5.9.0",
"nyc": "^13.0.1",
"nyc": "^13.1.0",
"touch": "^3.1.0",
"uglifyify": "^5.0.1",
"version-bump-prompt": "^4.2.0"
"version-bump-prompt": "^4.2.1"
},

@@ -63,4 +63,4 @@ "dependencies": {

"offset-sourcemap-lines": "^1.0.1",
"ono": "^4.0.9",
"through2": "^2.0.3"
"ono": "^4.0.10",
"through2": "^3.0.0"
},

@@ -67,0 +67,0 @@ "engines": {

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