Socket
Socket
Sign inDemoInstall

@quintype/copyright-header

Package Overview
Dependencies
50
Maintainers
30
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @quintype/copyright-header

To manage copyright headers in source files


Version published
Weekly downloads
61
increased by3.39%
Maintainers
30
Created
Weekly downloads
 

Readme

Source

Add or update copyright headers on source code files by scanning directory patterns recursively.

Installation

Global:

npm i @quintype/copyright-header -g

As local devDependency:

npm i @quintype/copyright-header --save-dev

Usage Examples

List of supported file extensions supported:

copyright-header -s

Add or update copyright headers:

copyright-header -i "test/files/**/*" -f test/header.js

Options

Usage: copyright-header [options]

Options:
-f, --license-file <file>        copyright license file
-i, --include-path <paths>       recursively insert header in all files found in path (allows multiple file patterns separated by space and within double quotes '"')
-e, --exclude-path <paths>       skip adding headers for files in the path (allows multiple file patterns separated by comma space and within double quotes '"')
-u, --include-git-untracked      include git untracked files, by default git untracked files will be skipped
-s, --supported-file-extensions  list supported file extensions
-V, --version                    output the version number
-h, --help                       display help for command
  • Copyright license information in this file will be added as header to the source code files.
  • It should be a javascript file (.js) and can have dynamic content using template string.
  • Example license file,
// ************************************************************************
// *  © [2015 - ${new Date().getFullYear()}] Quintype Technologies India Private Limited
// *  All Rights Reserved.
// *************************************************************************
  • Program will read the license info as-is including empty lines after the comment, modify comment syntax based on the target file and append it to the target file beginning.
  • Make sure to check exact number of new lines added after the comment using text editors like vim. If using visual editors like vscode, then add an additional new line to the number of ones intended.

Add support for new language/file extensions

  • Add an entry in the file copyright-header/src/config/index.ts under SUPPORTED_LANGUAGES, similar to the one below
 {
    name: 'Ruby',
    fileExtensions: ['rb'],
    commentSyntax: {
      singleLine: {
        start: ['#']
      }
    }
  }

FAQs

Last updated on 07 Mar 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc