Javascript Code Samples



Filters


How to Connect to a mongodb database using mongoose in nodejs
harika | 6 years, 3 months
const mongoose = require("mongoose");
mongoose.connect("mongodb://127.0.0.1:27018/koder-mongo-app",
nodejs mongoose javascript
delete a folder in javascript
harika | 7 years, 3 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 | 7 years, 1 month
$.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 | 7 years, 5 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
How to change the location of views in express handlebars
harika | 6 years, 3 months
//Express handlebars expect the views folder to be views,
//to configure or change the name from vi
express dynamic templating javascript
Difference between state and stateless components in react js
harika | 7 years, 6 months
//State Component
<!DOCTYPE html>
<html>
Stateless Component : A pure dumb component just process the request on the set of properties and re
javascript react js
Create a React app without webpack and Create-react-app
harika | 7 years, 6 months
//Basic way
<!DOCTYPE html>
<html>
javascript react js webpack
Import any class irrespective of default exports
harika | 7 years, 6 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
work with react without node installation in html
harika | 7 years, 6 months
//Basic way
<!DOCTYPE html>
<html>
javascript react js html
Command line arguments parsing in NodeJS with yargs and add a simple commands
kishore_kumar | 6 years, 8 months
const yargs = require("yargs")

yargs.command({
javascript node js
Next