npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

douserver

v1.4.6

Published

A simple Web server using express.js

Downloads

156

Readme

🧰 DouServer WebServer

DouServer Webserver is a secure webserver who uses Express.js and commands line to work.

📀 Requirements

To work properly, DouServer requires:

Bases:

Packages:

note: all these packages are on npmjs.org and can be installed with the command npm install xyz (xyz is the package name)

🖥 Installation

Using npmjs

To install DouServer from npmjs, follow theses eaasy steps:

  1. Make sure that you have node js and npm installed on your device
  2. use this command in the terminal:
npm install -g douserver

You now can use dserver ! If you got any errors, try installing from source

Install from source

To install DouServer from source, follow these easy steps:

  1. Make sure that you have node js and npm installed on your device
  2. open a terminal
  3. copy and paste this command in the terminal:
curl -sSL https://douxx.xyz/dserver/install.sh | bash

If there is an error, you can install DouServer step by step:

sudo git clone https://github.com/douxxu/DouServer.git
cd DouServer
sudo npm install express morgan yargs colors
sudo chmod +x cmd.js
sudo npm link
  1. DouServer is now installed, you can now run it with
dserver

⚡️ Running DouServer

You can run DouServer using the following command:

dserver

This command will run a basic web server, the default port is the http port (80), and the default index file is the /public/index.html file, you can access it from http://localhost:80.

You can use the differents arguments for editing the web server:

______ _____ _   _ _____ ___________ _   _ ___________ 
|  _  \  _  | | | /  ___|  ___| ___ \ | | |  ___| ___ \
| | | | | | | | | \ `--.| |__ | |_/ / | | | |__ | |_/ /
| | | | | | | | | `--. \  __||    /| | | |  __||    / 
| |/ /\ \_/ / |_| /\__/ / |___| |\ \\ \_/ / |___| |\ \ 
|___/  \___/ \___/\____/\____/\_| \_\___/\____/\_| \_|
----------------------------------------------------------------
| Server created by Douxx.xyz (https://github.com/douxxu/)     |
----------------------------------------------------------------
𝗔𝘃𝗮𝗶𝗹𝗮𝗯𝗹𝗲 𝗼𝗽𝘁𝗶𝗼𝗻𝘀:
| -p, --port [port]: Specifies the server port
| -s, --shield: Activates Shield mode to limit requests
| -bl, --blacklist [ip1 ip2 ...] : List of IP addresses to be blocked
| -t, --start [minutes]: Automatically starts the server after a set time.
| -i, --index [path]: Specify HTML index file path
| -r, --robots: Blocks robots if the option is present
| -h: Shows this help message

𝐄𝐱𝐚𝐦𝐩𝐥𝐞 𝐮𝐬𝐚𝐠𝐞:
----------------------------------------------------------------
| dserver -p 3000 -s -bl 127.0.0.1 -t 1 -i ./public/index.html -r
----------------------------------------------------------------

Options: -p [port]/--port [port]: Specify the server port. Usage: dserver -p 8080: Server will be hosted on http://127.0.0.1:8080.

-s/--shield: If this option is enabled, the server will automatically blacklist all ip's exceeding the allowed request limit every 5 seconds. The default number of requests is 10. This can be changed with the line const rlimit = 10;. Usage: dserver -s: server will activate shield mode.

-bl [ips]/--blacklist [ips]: With this option, you can disable access to the server for given ips. Usage: dserver -bl 192.168.0.0 192.168.0.1 10.0.0.2: Ips '192.168.0.0', '192.168.0.1' and '10.0.0.2' will be blacklisted.

-t [time]/--start [time]: Will set a countdown before the server starts. Usage: dserver --start 1: The server will start after 1 minute.

-i/--index: Will set the default page (/) file to the given file. Usage: dserver -i /path/to/your/file.html: The server default file will be file.html.

-r/--robots: If this option is enabled, the server will remove access to bots. Usage: dserver -r.

note: you can also host images, doing this command:

dserver -i /path/to/your/image.png

📃 Website pages (/)

You can easily create website pages adding a new folder into the public folder and putting an index.extention file into this folder. The page will have the name of folder. Exemple: we can access to the image into the /public/image going to http://127.0.0.1:port/image. Same for the html and txt folder. Here are the default pages:

  • http://localhost:1111/
  • http://localhost:1111/html
  • http://localhost:1111/image
  • http://localhost:1111/txt
  • http://localhost:1111/

[SERVER] messages

A log system was implemented to the server. All the [SERVER] messages in the console are server logs. There is all the type of logs:

  1. Launching logs: [SERVER] Server is running at http://127.0.0.1:1111 these logs are giving you the server URL.

  2. Requests logs: [SERVER] [DD/MM/YYYY, hh:mm:ss] - 127.0.0.1 - 1 these logs provide you with the ip of the visitor to your website, as well as the number of times this ip has visited your website in this session. The log is formed as follows: [SERVER] [date, time] - ip adrs. - number of visits by this ip. The visitor's user agent can be found in the server.log file.

  3. Blacklist logs: [SERVER] [DD/MM/YYYY, hh:mm:ss] - BLACKLISTED IP 127.0.0.1 tried to connect. these logs only appear if you have blacklisted one or more ips with the -bl parameter, and one of these ips has tried to access your server. (127.0.0.1 is the blacklisted ip adrs.)

  4. Shield logs: [SERVER] [DD/MM/YYYY, hh:mm:ss] - 127.0.0.1 exceeded requests threshold (3). this log occurs when the -s (--shield) parameter has been activated, and an ip address has exceeded the limit of 3 requests every 5 seconds.

  5. Index file log: [SERVER] Using custom index file: /path/to/your/index/file.html this log confirms that the custom index file you configured with the -index [path] parameter has been used.

💾 Tested devices / os

Devices

Os

LICENSE

Check the license file