sasjs-cli
is a Command-Line Interface to assist with creating, building, and deploying HTML5 Web Applications on the SAS platform. It fulfills 3 main purposes:
- Creation of a project repository in an 'opinionated' way
- Compilation each service, including all the dependent macros and pre / post code
- Deployment script generation - run this in SAS Studio to create all your backend services in Viya or SAS9.
There is also a feature to let you deploy your frontend as a service, bypassing the need to access the SAS Web Server.
- Install globally using
npm
as follows:
npm i -g sasjs-cli
- You will then be able to run the command
sasjs
from your command line with one of the available options.
sasjs <option>
create
: creates the folders and files required for SAS development. You can use this command in two ways:sasjs create folderName
- which creates a new folder with the name specified. An alias for this command issasjs c folderName
.sasjs create
- which creates the files and folder in the current working directory. If this directory is an existing NPM project with apackage.json
file, this command addsmacrocore
to the list of dependencies in that file. Else, it will initialise a new NPM project and then installmacrocore
. An alias for this command issasjs c
.
build targetName
: loads dependencies and builds services for SAS, for the specified build target name. If no target is specified, it builds the first target specified inconfig.json
. An alias for this command issasjs b folderName
.web
: generates SAS services for streaming your HTML, CSS and JavaScript-based app from a SAS server. This command is automatically run as part ofsasjs build
ifstreamWeb
is set to true for a particular build target. An alias for this command issasjs w
.help
: displays help text. Aliases for this command aresasjs h
,sasjs --help
,sasjs -help
andsasjs --h
.version
: displays the currently installed version of SASjs CLI. Aliases for this command aresasjs v
,sasjs --version
,sasjs -version
andsasjs --v
.