DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for CRAO a CLI for creating react apps offline.

CRAO a CLI for creating react apps offline.

We can make it offline

We all know the struggle, every time we need to create a new react app wi must start by typing this command

npm create-react-app my-app

Then the skeleton of our app get created automatically with no build configuration, the problem here is there is a lot of NPM packages to download.
If you are like me living in a country with a very slow network, the process of creating new react app can take a while.
On the other hand if you are using a metered connection this is also can be a bad thing.

As we all know, necessity is the mother of invention.
So i made this tool that could help a lot of react developers to create apps offline and very fast you can find it here in NPM or in GitHub

installation

The installation process is as easy as drinking water.

npm install -g create-react-app-offline

Now we don't need internet, lets create our first app.

crao -n <app-name>

for example :

crao -n my-app

It will create a directory called my-app inside the current folder.
Inside that directory, it will generate the initial project structure and install the transitive dependencies:

my-app
β”œβ”€β”€ README.md
β”œβ”€β”€ node_modules
β”œβ”€β”€ package.json
β”œβ”€β”€ .gitignore
β”œβ”€β”€ public
β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”œβ”€β”€ index.html
β”‚   └── manifest.json
└── src
    β”œβ”€β”€ App.css
    β”œβ”€β”€ App.js
    β”œβ”€β”€ App.test.js
    β”œβ”€β”€ index.css
    β”œβ”€β”€ index.js
    β”œβ”€β”€ logo.svg
    └── serviceWorker.js
    └── setupTests.js

Let's help each other

You can visit the repo on github or follow me on twitter, and lets work together on making more open source projects.

Top comments (9)

Collapse
 
mwelwa profile image
Mwelwa Nkuta

it doesn't work on my computer.. OS: Ubuntu 20.04, it creates all the files but the **npm start **command returns errors

Collapse
 
michaeltesemma profile image
MichaelTesemma

Configure the react scripts in the app folder.

Collapse
 
mwelwa profile image
Mwelwa Nkuta

I tried it on my Windows Machine and it works perfectly

Collapse
 
yhoung24909577 profile image
obiabo Immanuel

type npm install react-script

or type npm install

Collapse
 
godlove1 profile image
godlove1 • Edited on

It a great project, I have been using it just to learn react but unable to create a production build please is there a solution to that? When I run npm run build it get stuck and nothing happens I don't know why

Collapse
 
yhoung24909577 profile image
obiabo Immanuel

it dosnt open the app on linux when you type npm start , it throws an error

Collapse
 
mrvaibh profile image
Vaibhav Shukla

Is this equally efficient as "npm create-react-app" ?

BTW, this is great when I don't have the internet access !

Collapse
 
blurtec profile image
Blurtec

Tried installing it on my win10 32-bit but keeps failing

Collapse
 
ahadalichowdhury profile image
S. M. Ahad Ali Chowdhury

How can i install axios in this folder for free??

Take Your Github Repository To The Next Level

Take Your Github Repository To The Next Level πŸš€οΈ: A step-by-step guide on creating the perfect Github repository.