Socket
Socket
Sign inDemoInstall

file-header

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-header

A CLI tool for generating file header from a configuration file and an EJS template.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

file-header

A CLI tool for generating file header from a configuration file and an EJS template.

Installation

install the package

npm i -g file-header

Edit the config file ( Optional )

Data to be presented on a file header is stored in a config file which is located at ~/.file-headers/template_data.js

The default content of this file will be as follows.

module.exports = {
  user: process.env.USER,
  email: process.env.USER + '@' + process.env.HOST,
  date: new Date(),
};

We can customize it as required. For example, change it to

module.exports = {
  user: 'Jake sully'
  email: 'gmail@jakesully.com'
  github: 'https://github.com/jakesully'
  date: new Date(),
};
Edit the EJS tempalte of the default file-header ( Optional )

The default file header template can be found at ~/.file-headers/default It is just EJS template. We can customize it to any extend.

If we require different template for each file type , create a file ~/.file-headers/<extention>

  • For javscript, create a custom template at ~/.file-headers/js and customize it.
  • If we want a custom header for '*.spec.js' file, create ~/.file-headers/spec.js and customize it

Usage

Commandline

file-header <filename.ext>

which will print the file header to your console.

Use with Vim editor

Add the below line to your vim config file

command! Header :execute '0r!file-header %'

Now, type :Header to add file header to your current buffer.

Keywords

FAQs

Package last updated on 26 May 2017

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