New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

prepend-header

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prepend-header

Works recursively:

  • 1.0.3
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Prepend text to a file / group of files

Works recursively:

Set-up:

  1. create a header.js that looks something like:
const year = new Date().getFullYear();
const text = `/*******************************************************************************
  * Licensed Materials - Property of IBM
  * (c) Copyright IBM Corporation ${year}. All Rights Reserved.
  *
  * Note to U.S. Government Users Restricted Rights:
  * Use, duplication or disclosure restricted by GSA ADP Schedule
  * Contract with IBM Corp.
  *******************************************************************************/\n\n`;
const match = 'Copyright IBM Corporation' // skip the file where this match is true
module.exports = {
  text,
  match,
};

  1. Run in command line:
  • node ./node_modules/prepend-header.js <GLOB> <HEADERPATH>

Example(s):

  • node ./node_modules/prepend-header/index.js src-web/**/*.js ./headers/header.js (all js files matching glob).
  • node ./node_modules/prepend-header/index.js src-web/after.js ./headers/header.js (single file)

Successful Output should look like:

[FILES from src-web/**/*]
Prepended license to src-web/after1.js
Prepended license to src-web/foo/after2.js
Prepended license to src-web/foo/after3.js

FAQs

Package last updated on 23 Apr 2018

Did you know?

Socket

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.

Install

Related posts

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