Answers for "initialize npm"

1

initialize npm

$ npm init
  ...
  package name: @airnovaet.com/hello-world
  ...
  test command: exit 0
  ...
Posted by: Guest on June-16-2021
3

npm default init

npm config ls -l	# List some default settings

npm config set <key> <value> -g	# Set default value for a key
npm config set init-author-name "John Doe" -g	# Set default author
npm config set init-version "1.0.0" -g	# Set default version
npm config set init-license "MIT" -g	# Set default license

npm config get <key>	# Get default value for a key

npm init -y	# Create package.json with default settings
Posted by: Guest on July-19-2020
7

what is npm init

The npm init command is a step-by-step tool to scaffold out your project. 
It will prompt you for input for a few aspects of the project 
in the following order:

The project's name,
The project's initial version,
The project's description,
The project's entry point (meaning the project's main file),
The project's test command (to trigger testing with something like Standard)
The project's git repository (where the project source can be found)
The project's keywords (basically, tags related to the project)
The project's license (this defaults to ISC - most open-source Node.js projects are MIT)
Posted by: Guest on November-22-2020
1

how to create npm project

//Load HTTP module
const http = require("http");
const hostname = '127.0.0.1';
const port = 3000;

//Create HTTP server and listen on port 3000 for requests
const server = http.createServer((req, res) => {

  //Set the response HTTP header with HTTP status and Content type
  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end('Hello World\n');
});

//listen for request on port 3000, and as a callback function have the port listened on logged
server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});
Posted by: Guest on October-23-2020

Browse Popular Code Answers by Language