New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

npm-post-install

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-post-install

Configure a npm git repo

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

npm-post-install

Help configuring a boilerplate git repo to fit custom npm modules.

Boiler plate repos are an excellent tool to get started quickly. It's however tedious to remember to do all the things that reconfigure the repo to specific projects.

This script is meant as a post-install binary that will reset package.json and the git repo to the boiler plate as the initial commit.

What this script does:

  • Seeks user input for:
    • new name & description for new npm module
    • picks a gitprofile from ~/.gitprofile (see below for format)
    • alternatively, seeks a username and email to configure the git repo
    • a git url to initialize the repo with
  • Rejiggers the package.json
  • Deletes previous git repository
  • Reinitializes the git repo
  • Configures a local username and email on the git repo.
  • Commits current state as the 'Initial commit'
  • Optionally (if a remote url is available), sets this up and pushes the changes to remote.

Installation

npm install npm-post-install

Usage

./node_modules/.bin/npm-post-install

.gitprofiles

It's common to have multiple git accounts and a constant pain to remember to set specific repos with proper username and emails. The ~/.gitprofiles is meant to provide a simple mechanism to store these. This module uses values in there to ease the typing.

The .gitprofiles has a simple json format, an example shown below:

{
  "profile1": {
    "username": "username1",
    "email": "email1@example.com"
  },
  "profile2": {
    "username": "username2",
    "email": "email2@example.com"
  }
}

The .gitprofiles can have any number of these profiles, though realistically, only about 3 have been tested. YMMV.

Keywords

npm

FAQs

Package last updated on 07 Feb 2016

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