- Table of Content
- Description Info
- GitHub Repository
- Installation Process
- Usage Info
- Contributing Guidelines
- Test Instructions
- Demonstration on YouTube
- License
- Questions and Contacts
Application node-gen-svg or Node Generator SVG files application provides simple graphical interface for creating trigonometry shapes with text and colors as a resulting output to help developers creating logos and icons. It is developed by using node.js v22.0.0 JavaScript runtime environment, Node Package Manager npm-v10.5.1 public registry and inquirer-v9.2.20 question-answer handler. Application can be invoked from ~/node-gen-svg> directory by using bash terminal command $ node index.js.
Node.js®-JavaScript runtime environment node.js-v22.0.0, Node Package Manager npm-v10.5.1 and Inquirer inquirer-v9.2.20. Then run following commands.
Download Node.js version v20.12.2, v21.7.3 or v22.0.0 from Node.js®-v22.0.0 official website and install at your local machine with Prebuilt Installer. It will include npm (v10.5.0) or npm (v10.5.1) depends on node.js version instolled. Then run those commands below. I use Git-Bash terminal and my default approximate PS1 or $PS1 (Prompt String 1) variable looks like [user@host: ~] /c/Users/user/dev/node-gen-svg> (main) $, so left dollar sign out of any coppied code that has to be runned, if any.
npm init -y
npm install inquirer@9.2.20
node index.js # after installation application is invoked by this lineAlternativelly, you can run git, curl or wget installation process on CLI terminal (Linux based CLI) to install Node Version Manager (nvm-v0.39.7) at first. After installing NVM you can install Node.js version at your choice, the latest one is v22.0.0. Node.js instalation process will install Node Package Manager (npm) by default npm-v10.5.0 or npm-v10.5.1 depends on node version installed. Last part is to install inquirer-v9.2.20 and not inquirer-version lower then inquirer-v9. Current version inquirer-v9.2.20 is based on esm an advanced ECMAScript module loader which. For information about inqirer, esm and versions available, reffer to inquirer and esm official website.
// inquirer-v9.2.20
import inquirer from 'inquirer';
import fs from 'fs/promises';
// some code goes here...
export default render;
//-------------------------------------------
// inquirer-v8 and lower
const inquirer = require('inquirer');
const fs = require('fs/promiss');
// some code goes here...
module.exports = render;Below is installation command that should instoller run using curl:
# installs nvm (Node Version Manager v0.39.7)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bashIf after running the curl command above, those lines under the section : << COMMENT apear, run lines blelow it.
: <<COMMENT
---
=> Profile not found. Tried ~/.bashrc, ~/.bash_profile, ~/.zprofile, ~/.zshrc, and ~/.profile.
=> Create one of them and run this script again
OR
=> Append the following lines to the correct file yourself:
---
COMMENT# this lines run manualy if curl do not activate Node Version Manager (nvm). You do not have to restart your terminal after this.
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvmThen try to install node.js v22.0.0, v20.12.2, v21.7.3
# download and install Node.js v22.0.0 with nvm
nvm install 22
# Now using node v22.0.0 (npm v10.5.1)
# check Node.js version
node -v
# v22.0.0
# check npm version
npm -v
# 10.5.1
# check nvm version
nvm -v
# 0.39.7OR any other version that you want.
nvm use 16
# Now using node v16.9.1 (npm v7.21.1)
node -v
# v16.9.1
nvm use 14
# Now using node v14.18.0 (npm v6.14.15)
node -v
# v14.18.0
nvm install 12
# Now using node v12.22.6 (npm v6.14.5)
node -v
# v12.22.6If you using GitBash terminal, navigate to your root folder and execute following line:
cd ~/
git clone https://github.com/nvm-sh/nvm.git .nvm
cd ~/.nvm
git checkout v0.39.7
# HEAD is now at bab86d5 v0.39.7
. ./nvm.sh # this activate and source nvm by executing nvm.sh shell script inside .nvm directoryNow add these lines below the end of your ~/git/ect/bash.bashrc file to have it automatically sourced upon login.
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completionFor more information about nvm and installation process reffer to GitHub nvm repo.
It is used for generating graphical logos with extension .svg by using Inquirer and NPM utilities under Node.js runtime environment.
Currentlly, at this stage there is no contributors but for more information any enquiry can be reffered to Question and Contact section.
Application runs by invoking command $ node index.js at ~/node-gen-svg> directory. Before running application, download compressed repo from githaub and installl packages globaly or at application root directory from the section Installation Process.
Install Jest by using npm as follows:
npm install --save-dev jestOR
npm i -D jestSearch for package.json file and inside alter following line:
{
"scripts": {
"test": "jest"
}
}Finally, navigate your terminal to the ~/node-gen-svg> directory and run
npm run testCommand npm run test will use ~/node-gen-svg/lib/class> directory in which we have a class and constructor parameters and processing file ~/node-gen-svg/lib/shapes-test.js which tests our classes, constructor, parameters and functions. Output are as follows:
Demonstration on YouTube
Demonstration of the application can be visited below.
Copyright © 2024, codeXdeveloper. Released under the MIT License.
Questions about application can be reffered to the author's GitHub account or you can Contact Me directly over an email.
