generate-github-directory
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

generate-github-directory

Test codecov

Get a Github directory quickly by a simple command.

Usage

Copy the URL on your web browser.

Run generate-github-directory command with the URL. (It is similar git clone)

That's it!

Install

You don't need to install it.

npx generate-github-directory <url> [directory]

Just use it with npx command.

But, if you install (npm install -g generate-github-directory), you can get the short command ghdir instead of generate-github-directory.

Command

npx generate-github-directory https://github.com/rocket-hangar/workspace-template
# It will be made `workspace-template` directory on your current location

npx generate-github-directory https://github.com/rocket-hangar/workspace-template project
# It will be made `project` directory on your current location

npx generate-github-directory https://github.com/rocket-hangar/workspace-template .
# It will be made files on your current location

Workspaces

If you use it in a yarn workspaces. (If there are exists yarn.lock and workspaces property on package.json)

It adds workspaces information to package.json files.

For example,

cd my-monorepo
npx generate-github-directory https://github.com/rocket-hangar/rocket-scripts-templates/tree/master/templates/web project

It will write package.json files like below.

// $PWD/package.json
{
  "workspaces": ["project"]
}
// $PWD/project/package.json
{
  "name": "project"
}

If you don't want to modify package.json files use the option --no-workspace <url>.

Alias

If you have URLs that you use frequently, you can give them aliases.

Make .ghdir.json file on your home directory like below. ($HOME/.ghdir.json)

{
  "alias": {
    "workspace": "https://github.com/rocket-hangar/workspace-template",
    "web": "https://github.com/rocket-hangar/rocket-scripts-templates/tree/master/templates/web",
    "electron": "https://github.com/rocket-hangar/rocket-scripts-templates/tree/master/templates/electron"
  }
}

Then you can use command with the alias.

generate-github-directory web my-web-project

Related Projects

Package Sidebar

Install

npm i generate-github-directory

Weekly Downloads

6

Version

1.2.0

License

MIT

Unpacked Size

19.7 kB

Total Files

9

Last publish

Collaborators

  • ssen