Javascript Programming Javascript Code Samples



Filters


delete a folder in javascript
harika | 2 years, 5 months
// Delete the files recursively.
//fs is a built in node module.
const fs = require('fs');
fs.rmdir deletes the directory only if it empty. So for that we have to delete the files recursively
javascript node js
Make a Get Request a url or an api end point in Jquery
kishore_kumar | 2 years, 3 months
$.get("https://httpbin.org/get", function(data){ 
	$.each(data, function(key, value){
		console.lo
jquery json javascript
Pass Data/Properties from child to parent in react js
harika | 2 years, 7 months
//Parent.js
import React from "react";
import Child from './Child'
Check by Parent.js,Place both in the same location and test. Happy Coding :-)
javascript react js
Create a React app without webpack and Create-react-app
harika | 2 years, 8 months
//Basic way
<!DOCTYPE html>
<html>
javascript react js webpack
Adjust browser height and width according to device / Screen height and width in electron app
harika | 2 years, 2 months
import electron from 'electron';
const screenElectron = electron.screen;
const mainScreen = screen
Add the piece of code while creating window in main.js and check the difference. Happy Coding :-)
javascript electron js
Work with 3rd party css libraries in react framework
harika | 2 years, 8 months
import React from 'react'
//No need to give the complete path, react framework internally searches 
javascript react js
Command line arguments parsing in NodeJS with yargs and add a simple commands
kishore_kumar | 1 year, 11 months
const yargs = require("yargs")

yargs.command({
javascript node js
Import any class irrespective of default exports
harika | 2 years, 8 months
import React, { Component } from 'react'
Small explanation to understand correctly In the external js file React has been tagged with expor
javascript react js
Run Java script code Synchronously inside a function with promises
harika | 2 years, 8 months
async function showAvatar() {

  // read our JSON
JavaScript follows Asynchronous way of running code when this comes to promises. If we give Async-Aw
javascript
Create webserver using expressjs
harika | 1 year, 5 months
//server.js
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
Next