Skip to content

Instantly share code, notes, and snippets.

{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
"console.log snippet": {
"scope": "javascript,typescript",
// Menu: react component
import '@johnlindquist/kit';
// "home" is a method that wraps `path.resolve` based on your home directory
// inspect(home('dev'));
let project = await arg('dir');
let name = await arg('name');
let filePath = home('dev', project + `/src/components/`, name);
// writes a file to the filePath using `fs-extra's` "outputFile"
// Menu: workspace-boilerplate
import '@johnlindquist/kit';
// "home" is a method that wraps `path.resolve` based on your home directory
// inspect(home('dev'));
let project = await arg('project name');
let projectDir = home('dev', project);
mkdir(projectDir);
mkdir(projectDir + '/packages');