0.0.8 • Published 6 years ago
@cypherlab/okk v0.0.8
@cypherlab/okk
Whatever project you're working on, okk gives you access (via the command line) to a set of tools and commands that you can use to optimize your development workflows and manage your projects.
Install via NPM
yarn global add @cypherlab/okkCommands
init
okk init // create/update .okkrc filepkgs
Manage you multi repo packages.
okk pkgs
okk pkgs ls
okk pkgs add [repo]script
Run a custom script
okk script // show all script
okk script foo // run ./scripts/foo.jsA script must exports a default async function:
export default async ({ utils, okk }) => {
// pull some utils fonctions
const { pwdImport, shell } = utils
// import some random file from your current project folder
const { default: users } = await pwdImport('./assets/users.js')
// echo data
shell.echo(users.join(''))
// return a valid exit code (0,1,2)
return 0
}From there, you have access to okk utility functions (via utils), and also to the okk instance (via okk)
by default, okk looks into a ./scripts folder for scripts. To change the default path add dirs.scripts path in your .okkrc file.
{
"dirs":
"scripts": "./pathToScriptsFolder"
}
}Install from local repo
// clone this repo
git clone git@github.com:cypherlab/okk.git
// install package globaly
yarn run link
// update okk
git pull
yarn run link
// delete okk
yarn run unlink
// work on okk codebase:
// first unlink global okk yarn package
// then work in the repo, when done reinstall package globaly
yarn run unlink
// work
yarn run link