Building Code Bases
Create Code Base
You can either keep using
npx ns-flip or you can install the cli and just use
ns for every call:
npm i -g ns-flip
Installing it globally will make it faster. On the other hand, you won't automatically have the latest version of
ns-flip when you use it.
Install your template. For instance, this sample template is used in the examples below.:
mkdir ~/ns TEMPLATES=~/ns/templates mkdir $TEMPLATES cd $TEMPLATES git clone firstname.lastname@example.org:YizYah/basicNsFrontTemplate.git TEMPLATE=$TEMPLATES/basicNsFrontTemplate
Create a first code base:
PROJECT_NAME=multitask CODE=~/temp/$PROJECT_NAME npx ns-flip generate $CODE -t $TEMPLATE
Warning: for some templates, creating the code for the first time can take a while. A template may run a number of steps including installations.
Update Ns File
The ns-file tells what you need to customize your base code. Your default one should have generated code already.
Open your default ns file (
$CODE/meta/ns.yml). Also read the instructions provided by your template. Minimally, your template README should tell you any unique data that needs to be contained in your ns file.
Regenerate the Code Base
npx ns-flip generate $CODE
The code is now ready for adding custom code.
You can repeat steps 1 and 2 whenever you like.
Updating the Template
Note that you should call
generate with the
-t flag any time you update your template.
npx ns-flip generate $CODE -t $TEMPLATE
If you have any problems, please feel free to ask for help on our community. Feel free to message us individually.