Coder Social home page Coder Social logo

jpelaa / create-copyright-header Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 2.0 922 KB

CLI - to add copyright and license header to all files in the project

Home Page: https://www.npmjs.com/package/create-copyright-header

License: MIT License

JavaScript 100.00%
cli nodejs fs cli-tools copyright-updater license create-copyright-header javascript npm sonarqube-reports

create-copyright-header's Introduction

Create-copyright-header

This is CLI - to add copyright and license header to all files in the project

Logo

## Prerequisites

CLI require Node 8.9 or higher, together with NPM 5.5.1 or higher.

Quick Overview

npx create-copyright-header --generate

If you've previously installed create-copyright-header globally via npm install -g create-copyright-header, we recommend you uninstall the package using npm uninstall -g create-copyright-header or yarn global remove create-copyright-header to ensure that npx always uses the latest version.

Installation

All that's needed to install create-copyright-header is to use npm to install it globally. For Linux sudo may be required.

npm install -g create-copyright-header

Introduction

create-copyright-header - commandline generate copyright header

Usage: npx create-copyright-header --generate create-copyright-header is a tool for generating copyright & license header, applying to given the directories and selected filetypes and updating at beginning of the files.

we take input from user for directories they want to change, file type they want to update. For a listing of options, use create-copyright-header --help.

Demo

demo

Example:

? Please select the directories which you want to add copyright header (Press <space> to select, <a> to toggle all, <i>
to invert selection)
>( ) .git
 ( ) .github
 ( ) bin
 ( ) lib
 ( ) static

 ? Please select the file type below are supported file types (Press <space> to select, <a> to toggle all, <i> to invert
selection)
>( ) JavaScript
 ( ) HTML
 ( ) CSS
 ( ) Kotlin
 ( ) Java
 ( ) JSP
 ( ) PHP
 ( ) Python
 ( ) .NET

 ? Enter the copyright header content Press <enter> to launch your preferred editor.
 /*
* Copyright (c) 2012 - 2014 {Company Org}.
* All rights reserved.
*/

Thank you for ur response. we are working on file updates
lib checking...
[|||||||||||||||||||||||||||||||||------------------------------------------------------------------] 34%
lib\filewrite.js is updated
lib checking...
[||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||---------------------------------] 67%
lib\initializer.js is updated
lib checking...
[|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||] 100%
lib\utils.js is updated
static checking...
[|||||||||||||||||||||||||||||||||------------------------------------------------------------------] 34%
static\fileTypes.js is updated
static checking...
[||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||---------------------------------] 67%
static\folderExcludeList.js is updated
static checking...
[|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||] 100%
static\licenceCopyrightSamples.js is updated
updated all files Successfully please check

create-copyright-header's People

Contributors

jpelaa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

create-copyright-header's Issues

Fails on Mac with no helpful error message

Running on a MacBook, I get the following error:

? Enter the copyright header content › Waiting for editor...node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "1".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

Not that helpful to me. May be of use to the developers. No clue as to why it was unable to open an editor, or how I should set a default one!

write copyright/license header in git hooks

  • create copyright config with all user inputs values in the project root directory.
  • new CLI command to write copyright/license header in git hooks with global patterns (reference: prettier CLI ).
  • add documentation in the readme.
  • test this approach with sample projects.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.