Javascript Programming Javascript Code Samples


Create a simple web server with express using Node js
kishore_kumar | 4 years, 1 month
const express = require('express')

const app = express()
express javascript node js
Run shell files in javascript
harika | 4 years, 11 months
//JS Code
function runShellScript(){
    const process = require('child_process'); 
keep the function code inside the js file wherever you want to use. and keep the shell file provided
javascript shell node js
Compress files synchronously in javascript
harika | 4 years, 7 months
const tar = require('tar');
try to install 'tar' using npm and then try. Happy Coding :-)
node js javascript react js
Load native javascript inside webview in react-native
harika | 3 years, 5 months
import React, { Component } from 'react';
import {View,  WebView} from 'react-native-webview';

install react-native-webview using npm npm i react-native-webview --save try to load the compo
html react-native webview
How to use async-await with promises in nodejs
harika | 3 years, 8 months
const mul = (a, b) => {
  return new Promise((resolve, reject)=> {
nodejs javascript async
How to Connect to a mongodb database using mongodb in nodejs
harika | 3 years, 8 months
const {MongoClient, ObjectID} = require("mongodb");
const ConnectionURL = "mongodb://
nodejs javascript nodemon
Create webserver using expressjs
harika | 3 years, 8 months
const express = require("express")
const app = express()
Prerequisites : express suppose to be installed If not try npm i express inside the project folde
nodejs route javascript
Load html inside webview using react native
harika | 3 years, 5 months
// html.js
module.exports = function() { return `
Install react-native-webview using npm npm i react-native-webview --save try to seperate th
html react-native webview
Dynamic templating using express and handlebars
harika | 3 years, 8 months
const path = require("path");
const express = require("express")
express dynamic templating javascript
display state inside any html tag
harika | 4 years, 11 months
import React from 'react'
export default class StateProps extends React.Component {

Whatever html tag it is just wrap it inside curly braces ({}) as a value.
javascript react js
Prev Next