
Security News
OpenClaw Skill Marketplace Emerges as Active Malware Vector
Security researchers report widespread abuse of OpenClaw skills to deliver info-stealing malware, exposing a new supply chain risk as agent ecosystems scale.
Simple way to initialize a new git repository in an empty directory, add a file and do a first commit (or skip that part in a directory with files). Useful for unit tests and generators.
Simple way to initialize a new git repository in an empty directory, add a file and do a first commit (or skip that part in a directory with files). Useful for unit tests and generators.
Install with npm:
$ npm install --save gfc
Install with yarn:
$ yarn add gfc
var firstCommit = require('gfc');
// async
firstCommit(cwd[, options], function(err, stdout, stderr) {
if (err) {
console.error('exec error: ' + err);
return;
}
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
});
// sync
firstCommit.sync(cwd[, options]);
Example
var firstCommit = require('gfc');
var dir = 'foo/bar';
firstCommit(dir, function(err) {
if (err) {
console.log(err);
} else {
console.log('done!');
}
});
(NOTE: Most of the following examples will show async usage, but for the most part, the sync method works the same way without the callback)
By default, this library will:
temp.txt filegit add ."first commit"You can disable #2, or customize other behavior via options.
Type: string
Default: 'test fixture'
If not disabled, customize the contents of the default file added in step 2.
var options = {contents: 'my custom contents'};
firstCommit('foo/bar', options, function(err) {
if (err) {
console.log(err);
} else {
console.log('done!');
}
});
Type: boolean
Default: undefined
Disable adding the default file in step 2.
var options = {file: false};
firstCommit('foo/bar', options, function(err) {
if (err) {
console.log(err);
} else {
console.log('done!');
}
});
Type: string
Default: 'temp.txt'
If not disabled, customize the filename of the file added in step 2.
var options = {message: 'my amazing first commit'};
firstCommit('foo/bar', options, function(err) {
if (err) {
console.log(err);
} else {
console.log('done!');
}
});
Type: string
Default: 'first commit'
Customize the first commit message.
var options = {message: 'my amazing first commit'};
firstCommit('foo/bar', options, function(err) {
if (err) {
console.log(err);
} else {
console.log('done!');
}
});
Type: object
Default: undefined
Options to pass to execSync.
var options = {
message: 'my amazing first commit',
exec: {
timeout: 3000,
killSignal: 'SIGTERM'
}
};
firstCommit.sync('foo/bar', options);
Type: boolean
Default: false
Initialize the repo and create the file but don't git commit or git add ..
var options = { skipCommit: true };
firstCommit.sync('foo/bar', options);
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Please read the contributing guide for advice on opening issues, pull requests, and coding standards.
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
Jon Schlinkert
Copyright © 2017, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.5.0, on April 19, 2017.
FAQs
Simple way to initialize a new git repository in an empty directory, add a file and do a first commit (or skip that part in a directory with files). Useful for unit tests and generators.
The npm package gfc receives a total of 28 weekly downloads. As such, gfc popularity was classified as not popular.
We found that gfc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Security researchers report widespread abuse of OpenClaw skills to deliver info-stealing malware, exposing a new supply chain risk as agent ecosystems scale.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.