Answers for "create npm package"

2

create python package

python3 setup.py sdist bdist_wheel
Posted by: Guest on February-13-2020
0

composer add package

composer require name-of-package
Posted by: Guest on February-18-2020
3

install an npm package

npm install package-name

To save as a dependency:
npm install package-name --save
Posted by: Guest on May-25-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 Worldn');
});

//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

Python Answers by Framework

Browse Popular Code Answers by Language