
Security News
The Nightmare Before Deployment
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.
create-git
Advanced tools
A generator to initialize a project with git.
Features
$ npm init git
# or
$ npx create-git
# or
$ npm install -g create-git
$ create-git
$ create-git --help
create-git
initalize a git repo
Options:
--help Show help [boolean]
--version Show version number [boolean]
--cwd, -d Directory to run in [default: process.cwd()]
--primary-branch, -b Primary branch for repo [string] [default: main]
--initial-commit-message, -m Message for initial commit [string]
--remote-origin, -o Git remote origin [string]
--ignore-templates, -t Ignore templates from
github.com/github/gitignore
[default: Node.gitignore]
--additional-rules comma separated list of ignore lines [string]
--ignore-existing Ignore existing .gitignore and package.json
files [default: false]
--commit-all Commit all files (not just the new .gitignore
[boolean] [default: true]
--push Push to remote origin when complete
[boolean] [default: true]
const createGit = require('create-git')
await createGit({
primartBranch: 'main',
ignoreExisting: false,
initialCommitMessage: '',
remoteOrigin: '', // Will also load from the package.json repository field
ignoreTemplates: ['Node.gitignore'],
additionalRules: [],
push: true,
commitAll: true
})
create-* packagesThis generator is built on top of opta, a helper library for collecting
user input from multiple interfaces: CLI via yargs, interactive prompts via inquirer
and via a JS interface. To compose with other opta based input collection,
you can use .options to access the cli/prompt/js configurations.
const createGit = require('create-git')
const opta = require('opta')
// My wrapper which asks github username and repo to
// generate the `remoteOrigin`
const opts = opta({
commandDescription: 'Create github repo',
options: {
// Spread the options from createGit
...createGit.options,
// Add our additional prompts
githubOrg: {
prompt: {
message: 'GitHub User/Org:'
}
},
githubRepo: {
prompt: {
message: 'GitHub repo:'
}
},
// Override createGit.options.remoteOrigin
remoteOrigin: {
...createGit.options.remoteOrigin,
default: (promptInput, allInput) => {
return `https://github.com/${allInput.githubOrg}/${allInput.githubRepo}`
}
}
}
})
// Our generator main
module.exports = async function (input) {
// Add our input as overrides on the opta instance
options.overrides(input)
// Prompt the user,
// by overriding remoteOrigin's default above
// it will now ask for the org and repo first,
// then set the default for the remote origin
// based on that input
await options.prompt()
// Get the current values from the opta instance
let opts = options.values()
// Call create git
await createGit(opts)
}
For more information check out the docs for opta.
FAQs
Initalize a git repository with some helpful extras
The npm package create-git receives a total of 18 weekly downloads. As such, create-git popularity was classified as not popular.
We found that create-git demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.

Research
/Security News
Impostor NuGet package Tracer.Fody.NLog typosquats Tracer.Fody and its author, using homoglyph tricks, and exfiltrates Stratis wallet JSON/passwords to a Russian IP address.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.