initialiseur
v5.1.1
Published
THIS IS A BOILER PLATE CODE INITIALIZER FOR NODE.JS APPLICATIONS (express, koa, electron).
Downloads
40
Maintainers
Readme
initialiseur
This is a package that can be installed on your computer to easily initialize node.js
node applications boiler plates:
It initializes the following boiler plate code
- express
- koa
- electron
Express Application
This backend server is an express
application with cors
configured that is ready to run on a configured default port 3001
which can be modified in code. This package can initialize boiler plate code for a basic express application for the following languages:
- javascript
- typescript
(default)
Generated files for an express
boiler plate:
Generating Basic Files(🌼) and Folders(📁)
📁 src
📁 routes
🌼 index.ts
🌼 server.ts
🌼 .gitignore
🌼 .env
🌼 package.json
🌼 tsconfig.json
Koa Application
This backend server is an koa
that is ready to run on a configured default port 3001
which can be modified in code. This package can initialize boiler plate code for a basic express application for the following languages:
- javascript
- typescript
(default)
Generated files for an koa
boiler plate:
Generating Basic Files(🌼) and Folders(📁)
📁 src
📁 routes
📁 hello
🌼 index.ts
🌼 server.ts
🌼 .gitignore
🌼 .env
🌼 package.json
🌼 tsconfig.json
Electron
This is skeleton electron application that is ready and running. All you have to do it to change the code according to what you want your application to do. The current version 5.0.*
is currently having one language initialization for an electron application which is:
javascript
Generated files for an electron
boiler plate:
Generating Basic Files(🌼) and Folders(📁)
📁 src
📁 public
🌼 index.html
📁 scripts
🌼 index.js
🌼 preload.js
📁 styles
🌼 index.css
🌼 main.js
🌼 .gitignore
🌼 README.md
🌼 LICENSE
🌼 .env
🌼 package.json
Note that this package is coming from
@crispengari/node-backend
.
Getting started
First you need to install the node initialiseur
globally by running the following command:
- Using
npm
npm install -g initialiseur
- Using
yarn
yarn global add initialiseur
Usage
To initialize a new node
boiler plate application you run the following command:
initialiseur init <name>
Note that you can initialize the
node.js
backend project without installinginitialiseur
globally by the use ofnpx
:
npx initialiseur init <name>
<name>
is optional if note specifiedinitialiseur
will use theroot
directory of the project as the default package name, which can be altered as well.
Available commands in initialiseur
- help
This shows all available commands of
initialiseur
package
initialiseur -h
# or
initialiseur --help
- version
This shows the currently installed version of
initialiseur
package:
initialiseur -v
# or
initialiseur --version
- init
This initializes a new initialiseur
project:
initialiseur init <name>
# Or
initialiseur init
Starting the apps.
Note: Starting the server is different if you are using typescript
or javascript
and if you are using electron
, koa
or express
.
- With
JavaScript
:
# yarn
yarn start
# npm
npm run start
The above command start a application for both
electron
,koa
andexpress
. Theelectron
application is currently starting with one command which is thestart
.
- With
TypeScript
:
With ts
you have to open two command the one that will watch
for file changes and the other one that will run the compiled javascript code:
a) cmd
1
# yarn
yarn watch
# npm
npm run watch
b) cmd
2
# yarn
yarn dev
# npm
npm run dev
Or you can run a single command which was introduced in version 5.1.*
which is:
# yarn
yarn start:fast
# npm
npm run start:fast
The above commands can only be run when you are either running a typescript application for either
koa
orexpress
.
From @crispengari/node-backend
to initialiseur
Initialiseur
was initially @crispengari/node-backend
so you can initialize the node.js
backend by running executing @crispengari/node-backend
using npx
.
Executing specific versions
You can be able to execute the specific versions of @crispengari/node-backend
using the node package executer (npx)
- Running the node package executer
npx
npx @crispengari/node-backend@<version>
# example (make sure the version exists before running this)
npx @crispengari/node-backend@<1.3.2>
Available working versions
v1
@crispengari/[email protected]
@crispengari/[email protected]
@crispengari/[email protected]
@crispengari/[email protected]
v2
@crispengari/[email protected]
v3
What's new in initialiseur@4.*.*
?
- In this version developers are allowed to choose licenses templates from the available ones during backend initialization.
- Developers can also select which additional optional files they want to add in their project during initialization.
What is new in initialiseur@5.*.*
?
- In this version developers are now able to select the application they want to initialize between:
- express application
- electron application
- koa application
- Developers still have choice to choose the programming language to be used among:
- javascript
- typescript
- The language choices are currently working for the following applcations:
- koa application
- express application
Why initialiseur
?
initialiseur
is a name that I got from google translation english to french for the name initializer
. I created this package so that developers can create their backend applications with typescript or javascript without running into a headache of creating files and installing basic packages like express
.
Commonly Known Issues.
- The
initialiseur
package has commonly known issue when for starting thekao
orexpress
server for the first time with thestart:fast
command for bothnpm
andyarn
. The error is as follows:
Error: Cannot find module './server.js'
The solution to this is to either open one of your
ts
boiler plate files and save it or you stop the command and run it again.
License
MIT License
Copyright (c) 2021 Crispen Gari
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.