From 6b78398fbab6057be24286fe95dee5804cc9cb8f Mon Sep 17 00:00:00 2001 From: Aarthy Date: Tue, 15 Apr 2025 09:13:00 +0530 Subject: [PATCH] web scraping methodology --- data/raw/tutorial_course.json | 1551 +++++++++++++++++ data/raw/tutorial_info.csv | 50 + data/raw/tutorial_modules.csv | 50 + main.py | 81 + src/__init__.py | 0 src/__pycache__/__init__.cpython-312.pyc | Bin 0 -> 150 bytes src/__pycache__/app.cpython-312.pyc | Bin 0 -> 3234 bytes src/app.py | 54 + src/exporters/__init__.py | 6 + .../__pycache__/__init__.cpython-312.pyc | Bin 0 -> 385 bytes .../__pycache__/base.cpython-312.pyc | Bin 0 -> 1142 bytes .../__pycache__/csv_exporter.cpython-312.pyc | Bin 0 -> 2243 bytes .../__pycache__/json_exporter.cpython-312.pyc | Bin 0 -> 1638 bytes src/exporters/base.py | 17 + src/exporters/csv_exporter.py | 41 + src/exporters/json_exporter.py | 25 + src/models/__init__.py | 4 + .../__pycache__/__init__.cpython-312.pyc | Bin 0 -> 312 bytes src/models/__pycache__/schema.cpython-312.pyc | Bin 0 -> 2152 bytes src/models/schema.py | 38 + src/scrapers/__init__.py | 5 + .../__pycache__/__init__.cpython-312.pyc | Bin 0 -> 316 bytes src/scrapers/__pycache__/base.cpython-312.pyc | Bin 0 -> 3430 bytes .../__pycache__/w3schools.cpython-312.pyc | Bin 0 -> 6585 bytes src/scrapers/base.py | 57 + src/scrapers/w3schools.py | 144 ++ uv.lock | 640 ------- 27 files changed, 2123 insertions(+), 640 deletions(-) create mode 100644 data/raw/tutorial_course.json create mode 100644 data/raw/tutorial_info.csv create mode 100644 data/raw/tutorial_modules.csv create mode 100644 main.py create mode 100644 src/__init__.py create mode 100644 src/__pycache__/__init__.cpython-312.pyc create mode 100644 src/__pycache__/app.cpython-312.pyc create mode 100644 src/app.py create mode 100644 src/exporters/__init__.py create mode 100644 src/exporters/__pycache__/__init__.cpython-312.pyc create mode 100644 src/exporters/__pycache__/base.cpython-312.pyc create mode 100644 src/exporters/__pycache__/csv_exporter.cpython-312.pyc create mode 100644 src/exporters/__pycache__/json_exporter.cpython-312.pyc create mode 100644 src/exporters/base.py create mode 100644 src/exporters/csv_exporter.py create mode 100644 src/exporters/json_exporter.py create mode 100644 src/models/__init__.py create mode 100644 src/models/__pycache__/__init__.cpython-312.pyc create mode 100644 src/models/__pycache__/schema.cpython-312.pyc create mode 100644 src/models/schema.py create mode 100644 src/scrapers/__init__.py create mode 100644 src/scrapers/__pycache__/__init__.cpython-312.pyc create mode 100644 src/scrapers/__pycache__/base.cpython-312.pyc create mode 100644 src/scrapers/__pycache__/w3schools.cpython-312.pyc create mode 100644 src/scrapers/base.py create mode 100644 src/scrapers/w3schools.py delete mode 100644 uv.lock diff --git a/data/raw/tutorial_course.json b/data/raw/tutorial_course.json new file mode 100644 index 0000000..f7ebe68 --- /dev/null +++ b/data/raw/tutorial_course.json @@ -0,0 +1,1551 @@ +{ + "title": "W3Schools Tutorial", + "source_url": "https://www.w3schools.com/nodejs/nodejs_intro.asp", + "modules": [ + { + "title": "Node.js HOME", + "url": "https://www.w3schools.com/nodejs/default.asp" + }, + { + "title": "Node.js Intro", + "url": "https://www.w3schools.com/nodejs/nodejs_intro.asp" + }, + { + "title": "Node.js Get Started", + "url": "https://www.w3schools.com/nodejs/nodejs_get_started.asp" + }, + { + "title": "Node.js Modules", + "url": "https://www.w3schools.com/nodejs/nodejs_modules.asp" + }, + { + "title": "Node.js HTTP Module", + "url": "https://www.w3schools.com/nodejs/nodejs_http.asp" + }, + { + "title": "Node.js File System", + "url": "https://www.w3schools.com/nodejs/nodejs_filesystem.asp" + }, + { + "title": "Node.js URL Module", + "url": "https://www.w3schools.com/nodejs/nodejs_url.asp" + }, + { + "title": "Node.js NPM", + "url": "https://www.w3schools.com/nodejs/nodejs_npm.asp" + }, + { + "title": "Node.js Events", + "url": "https://www.w3schools.com/nodejs/nodejs_events.asp" + }, + { + "title": "Node.js Upload Files", + "url": "https://www.w3schools.com/nodejs/nodejs_uploadfiles.asp" + }, + { + "title": "Node.js Email", + "url": "https://www.w3schools.com/nodejs/nodejs_email.asp" + }, + { + "title": "MySQL Get Started", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql.asp" + }, + { + "title": "MySQL Create Database", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_create_db.asp" + }, + { + "title": "MySQL Create Table", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_create_table.asp" + }, + { + "title": "MySQL Insert Into", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_insert.asp" + }, + { + "title": "MySQL Select From", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_select.asp" + }, + { + "title": "MySQL Where", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_where.asp" + }, + { + "title": "MySQL Order By", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_orderby.asp" + }, + { + "title": "MySQL Delete", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_delete.asp" + }, + { + "title": "MySQL Drop Table", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_drop_table.asp" + }, + { + "title": "MySQL Update", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_update.asp" + }, + { + "title": "MySQL Limit", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_limit.asp" + }, + { + "title": "MySQL Join", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_join.asp" + }, + { + "title": "MongoDB Get Started", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb.asp" + }, + { + "title": "MongoDB Create DB", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_create_db.asp" + }, + { + "title": "MongoDB Collection", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_createcollection.asp" + }, + { + "title": "MongoDB Insert", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_insert.asp" + }, + { + "title": "MongoDB Find", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_find.asp" + }, + { + "title": "MongoDB Query", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_query.asp" + }, + { + "title": "MongoDB Sort", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_sort.asp" + }, + { + "title": "MongoDB Delete", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_delete.asp" + }, + { + "title": "MongoDB Drop Collection", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_drop.asp" + }, + { + "title": "MongoDB Update", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_update.asp" + }, + { + "title": "MongoDB Limit", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_limit.asp" + }, + { + "title": "MongoDB Join", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_join.asp" + }, + { + "title": "RasPi Get Started", + "url": "https://www.w3schools.com/nodejs/nodejs_raspberrypi.asp" + }, + { + "title": "RasPi GPIO Introduction", + "url": "https://www.w3schools.com/nodejs/nodejs_raspberrypi_gpio_intro.asp" + }, + { + "title": "RasPi Blinking LED", + "url": "https://www.w3schools.com/nodejs/nodejs_raspberrypi_blinking_led.asp" + }, + { + "title": "RasPi LED & Pushbutton", + "url": "https://www.w3schools.com/nodejs/nodejs_raspberrypi_led_pushbutton.asp" + }, + { + "title": "RasPi Flowing LEDs", + "url": "https://www.w3schools.com/nodejs/nodejs_raspberrypi_flowing_leds.asp" + }, + { + "title": "RasPi WebSocket", + "url": "https://www.w3schools.com/nodejs/nodejs_raspberrypi_webserver_websocket.asp" + }, + { + "title": "RasPi RGB LED WebSocket", + "url": "https://www.w3schools.com/nodejs/nodejs_raspberrypi_rgb_led_websocket.asp" + }, + { + "title": "RasPi Components", + "url": "https://www.w3schools.com/nodejs/nodejs_raspberrypi_components.asp" + }, + { + "title": "Built-in Modules", + "url": "https://www.w3schools.com/nodejs/ref_modules.asp" + }, + { + "title": "Node.js Compiler", + "url": "https://www.w3schools.com/nodejs/nodejs_compiler.asp" + }, + { + "title": "Node.js Server", + "url": "https://www.w3schools.com/nodejs/nodejs_server.asp" + }, + { + "title": "Node.js Syllabus", + "url": "https://www.w3schools.com/nodejs/nodejs_syllabus.asp" + }, + { + "title": "Node.js Study Plan", + "url": "https://www.w3schools.com/nodejs/nodejs_study_plan.asp" + }, + { + "title": "Node.js Certificate", + "url": "https://www.w3schools.com/nodejs/nodejs_exam.asp" + } + ], + "tutorials": [ + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/default.asp", + "content": "Node.js Tutorial\n\n❮ Home\nNext ❯\n\n\nLearn Node.js\nNode.js is an open source server environment.\nNode.js allows you to run JavaScript on the server.\nStart learning Node.js now »\n\n\nLearning by Examples\nOur \"Show Node.js\" tool makes it easy to learn Node.js, it shows both the \ncode and the result.\n\nExample\n\n var http = require('http');http.createServer(function (req, res) {  res.writeHead(200, {'Content-Type': 'text/plain'});  res.end('Hello World!');}).listen(8080); \nRun example »\n\nClick on the \"Run example\" button to see how it works.\n\nExamples Running in the Command Line Interface\nIn this tutorial there will be some examples that are better explained by displaying the result in the \ncommand line interface.\nWhen this happens, The \"Show Node.js\" tool will show the result in a black screen on the right:\n\nExample\n\nconsole.log('This example is different!');\nconsole.log('The result is displayed in the Command Line Interface'); \nRun example »\n\nClick on the \"Run example\" button to see how it works.\n\n\nTrack Your Progress\n\n\nCreate a free W3Schools account and get access to more features and learning materials:\n\nView your completed tutorials, exercises, and quizzes\nKeep an eye on your progress and daily streaks\n\nSet goals and create learning paths\nCreate your own personal website\n\nSign Up for Free\n\n\n\n\nNote: This is an optional feature. You can study at W3Schools without creating an account.\n\nNode.js Reference\nNode.js has a set of built-in modules.\nBuilt-in Modules\n\nDownload Node.js\nDownload Node.js from the official Node.js web site:\nhttps://nodejs.org\n\n\n❮ Home\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var http = require('http');http.createServer(function (req, res) {  res.writeHead(200, {'Content-Type': 'text/plain'});  res.end('Hello World!');}).listen(8080);" + }, + { + "language": "javascript", + "code": "console.log('This example is different!');\nconsole.log('The result is displayed in the Command Line Interface');" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_intro.asp", + "content": "Node.js Introduction\n\n❮ Previous\nNext ❯\n\n\nWhat is Node.js?\n\nNode.js is an open source server environment\nNode.js is free\nNode.js runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)\nNode.js uses JavaScript on the server\n\n\nWhy Node.js?\n\nNode.js uses asynchronous programming!\n\nA common task for a web server can be to open a file on the server and return the content to \nthe client.\nHere is how PHP or ASP handles a file request:\n\nSends the task to the computer's file system.\nWaits while the file system opens and reads the \n file.\nReturns the content to the client.\nReady to handle the next \nrequest.\n\nHere is how Node.js handles a file request:\n\nSends the task to the computer's file system.\nReady to handle the next request.\nWhen the file system has \nopened and read the file, the server returns the content to the client.\n\n\nNode.js eliminates the waiting, and simply continues with the next request. \n\nNode.js runs single-threaded, non-blocking, asynchronous programming, which \nis very memory efficient.\n\nWhat Can Node.js Do?\n\nNode.js can generate dynamic page content\nNode.js can create, open, read, write, delete, and close files on the server\nNode.js can collect form data\nNode.js can add, delete, modify data in your database\n\n\nWhat is a Node.js File?\n\nNode.js files contain tasks that will be executed on certain events\nA typical event is someone trying to access a port on the server\nNode.js files must be initiated on the server before having any effect\nNode.js files have extension \".js\"\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_get_started.asp", + "content": "Node.js Get Started\n\n❮ Previous\nNext ❯\n\n\nDownload Node.js\nThe official Node.js website has installation instructions for Node.js:\nhttps://nodejs.org\n\nGetting Started\nOnce you have downloaded and installed Node.js on your computer, let's try to \ndisplay \"Hello World\" in a web browser.\nCreate a Node.js file named \"myfirst.js\", and add the following \ncode:\n\nmyfirst.js\n\n var http = require('http');http.createServer(function (req, res) {  res.writeHead(200, {'Content-Type': 'text/html'});\n   \n res.end('Hello World!');}).listen(8080);\n\nSave the file on your computer: C:\\Users\\Your Name\\myfirst.js\nThe code \ntells the computer to write \"Hello World!\" if anyone (e.g. a web browser) tries \nto access your computer on port 8080.\nFor now, you do not have to \nunderstand the code. It will be explained later.\n\nCommand Line Interface\nNode.js files must be initiated in the \"Command Line Interface\" program \nof your computer.\nHow to open the command line interface on your computer depends on the operating system. For Windows users, press the start button and look for \n\"Command \nPrompt\", or simply write \"cmd\" in the search field.\nNavigate to the folder that contains the file \"myfirst.js\", the \ncommand line interface \nwindow should look something like this:\n\n\nC:\\Users\\Your Name>_\n\n\n\nInitiate the Node.js File\nThe file you have just created must be initiated by Node.js before any action \ncan take place.\nStart your command line interface, write node myfirst.js and hit enter:\n\nInitiate \"myfirst.js\":\n\n C:\\Users\\Your Name>node myfirst.js\n\n\nNow, your computer works as a server!\nIf anyone tries to access your computer on port 8080, they will get a \"Hello \nWorld!\" message in return!\nStart your internet browser, and type in the address: http://localhost:8080\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var http = require('http');http.createServer(function (req, res) {  res.writeHead(200, {'Content-Type': 'text/html'});\n   \n res.end('Hello World!');}).listen(8080);" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>_" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node myfirst.js" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_modules.asp", + "content": "Node.js Modules\n\n❮ Previous\nNext ❯\n\n\nWhat is a Module in Node.js?\nConsider modules to be the same as JavaScript libraries.\nA set of functions you want to include in your application.\n\nBuilt-in Modules\nNode.js has a set of built-in modules which you can use without any further \ninstallation.\nLook at our Built-in Modules Reference for a \ncomplete list of modules.\n\nInclude Modules\nTo include a module, use the require() \nfunction with the name of the module:\n\n\n var http = require('http');\n\nNow your application has access to the HTTP module, and is able to create a server:\n\n\n http.createServer(function (req, res) {  \n res.writeHead(200, {'Content-Type': 'text/html'});  \n res.end('Hello World!');}).listen(8080);\n\n\nCreate Your Own Modules\nYou can create your own modules, and easily include them in your applications.\nThe following example creates a module that returns a date and time object:\n\nExample\nCreate a module that returns the current date and time:\n\n exports.myDateTime = function () {  return Date();};\n\nUse the exports keyword to make properties and methods available outside the module file.\nSave the code above in a file called \"myfirstmodule.js\"\n\n\n\n\n\n\nInclude Your Own Module\nNow you can include and use the module in any of your Node.js files.\n\nExample\nUse the module \"myfirstmodule\" in a Node.js file:\n\n var http = require('http');\nvar dt = require('./myfirstmodule');\n http.createServer(function (req, res) {  \n res.writeHead(200, {'Content-Type': 'text/html'}); \n res.write(\"The date and time are currently: \" + dt.myDateTime());\n   \n res.end();\n }).listen(8080);\nRun example »\n\nNotice that we use ./ to locate the module, that means that the \nmodule is located in the same folder as the Node.js file.\nSave the code above in a file called \"demo_module.js\", and initiate the file:\n\nInitiate demo_module.js:\n\nC:\\Users\\Your Name>node demo_module.js\n\n\nIf you have followed the same steps on your computer, you will see the same result as the example: http://localhost:8080\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var http = require('http');" + }, + { + "language": "javascript", + "code": "http.createServer(function (req, res) {  \n res.writeHead(200, {'Content-Type': 'text/html'});  \n res.end('Hello World!');}).listen(8080);" + }, + { + "language": "javascript", + "code": "exports.myDateTime = function () {  return Date();};" + }, + { + "language": "javascript", + "code": "var http = require('http');\nvar dt = require('./myfirstmodule');\n http.createServer(function (req, res) {  \n res.writeHead(200, {'Content-Type': 'text/html'}); \n res.write(\"The date and time are currently: \" + dt.myDateTime());\n   \n res.end();\n }).listen(8080);" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_module.js" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_http.asp", + "content": "Node.js HTTP Module\n\n❮ Previous\nNext ❯\n\n\nThe Built-in HTTP Module\nNode.js has a built-in module called HTTP, which allows Node.js to transfer \ndata over the Hyper Text Transfer Protocol (HTTP).\nTo include the HTTP module, use the\nrequire() method:\n\n\n var http = require('http');\n\n\nNode.js as a Web Server\nThe HTTP module can create an HTTP server that listens to \nserver ports and gives a response back to \nthe client.\nUse the createServer() method to create an \nHTTP server:\n\nExample\n\n var http = require('http');//create a server object:http.createServer(function \n (req, res) {  res.write('Hello World!'); //write a response to the \n client  res.end(); //end the response}).listen(8080); //the \n server object listens on port 8080\nRun example »\n\nThe function passed into the http.createServer() \nmethod, will be executed when someone tries to access the \ncomputer on port 8080.\nSave the code above in a file called \"demo_http.js\", and initiate \nthe file:\n\nInitiate demo_http.js:\n\nC:\\Users\\Your Name>node demo_http.js\n\n\nIf you have followed the same steps on your computer, you will see the same result as the example: http://localhost:8080\n\n\n\n\n\n\nAdd an HTTP Header\nIf the response from the HTTP server is supposed to be displayed as HTML, you \nshould include an HTTP header with the correct content type:\n\nExample\n\n var http = require('http');http.createServer(function \n (req, res) {  res.writeHead(200, \n {'Content-Type': 'text/html'});  res.write('Hello \n World!');  res.end();}).listen(8080);\nRun example »\n\nThe first argument of the res.writeHead() method is the status code, 200 means \nthat \nall is OK, the second argument is an object containing the response headers.\n\nRead the Query String\nThe function passed into the http.createServer() \nhas a req argument that represents the request from the \nclient, as an object (http.IncomingMessage object).\nThis object has a property called \"url\" which holds the \npart of the url that comes after the domain name:\n\ndemo_http_url.js\n\n var http = require('http');http.createServer(function \n (req, res) {  res.writeHead(200, {'Content-Type': 'text/html'});\n   res.write(req.url);  \n res.end();}).listen(8080);\n\nSave the code above in a file called \"demo_http_url.js\" and \ninitiate the file:\n\nInitiate demo_http_url.js:\n\nC:\\Users\\Your Name>node demo_http_url.js\n\n\nIf you have followed the same steps on your computer, you should see two \ndifferent results when opening these two addresses:\nhttp://localhost:8080/summer\n\nWill produce this result:\n\n/summer\nRun example »\n\nhttp://localhost:8080/winter\n\nWill produce this result:\n\n/winter\nRun example »\n\n\nSplit the Query String\nThere are built-in modules to easily split the query string into readable \nparts, such as the URL module.\n\nExample\nSplit the query string into readable parts:\n\n var http = require('http');var url = require('url');\n\n http.createServer(function (req, res) {  res.writeHead(200, \n {'Content-Type': 'text/html'});  var q = url.parse(req.url, \n true).query;  var txt = q.year + \" \" + \n q.month;  res.end(txt);\n }).listen(8080);\n\n\nSave the code above in a file called \"demo_querystring.js\" and \ninitiate the file:\n\nInitiate demo_querystring.js:\n\nC:\\Users\\Your Name>node demo_querystring.js\n\n\nThe address:\n\nhttp://localhost:8080/?year=2017&month=July\n\n\nWill produce this result:\n\n2017 July\nRun example »\n\nRead more about the URL module in the Node.js URL \nModule chapter.\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var http = require('http');" + }, + { + "language": "javascript", + "code": "var http = require('http');//create a server object:http.createServer(function \n (req, res) {  res.write('Hello World!'); //write a response to the \n client  res.end(); //end the response}).listen(8080); //the \n server object listens on port 8080" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_http.js" + }, + { + "language": "javascript", + "code": "var http = require('http');http.createServer(function \n (req, res) {  res.writeHead(200, \n {'Content-Type': 'text/html'});  res.write('Hello \n World!');  res.end();}).listen(8080);" + }, + { + "language": "javascript", + "code": "var http = require('http');http.createServer(function \n (req, res) {  res.writeHead(200, {'Content-Type': 'text/html'});\n   res.write(req.url);  \n res.end();}).listen(8080);" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_http_url.js" + }, + { + "language": "javascript", + "code": "/summer" + }, + { + "language": "javascript", + "code": "/winter" + }, + { + "language": "javascript", + "code": "var http = require('http');var url = require('url');\n\n http.createServer(function (req, res) {  res.writeHead(200, \n {'Content-Type': 'text/html'});  var q = url.parse(req.url, \n true).query;  var txt = q.year + \" \" + \n q.month;  res.end(txt);\n }).listen(8080);" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_querystring.js" + }, + { + "language": "javascript", + "code": "2017 July" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_filesystem.asp", + "content": "Node.js File System Module\n\n❮ Previous\nNext ❯\n\n\nNode.js as a File Server\nThe Node.js file system module allows you to work with the file system on your \ncomputer.\nTo include the File System module, use the \nrequire() method:\n\n\n var fs = require('fs');\n\nCommon use for the File System module:\n\nRead files\nCreate files\nUpdate files\nDelete files\nRename files\n\n\nRead Files\nThe fs.readFile() method is used to read files on your computer.\nAssume we have the following HTML file (located in the same folder as \nNode.js):\n\ndemofile1.html\n\n

My Header

My paragraph.

\n \n\nCreate a Node.js file that reads the HTML file, \nand return the content:\n\nExample\n\n var http = require('http');var fs = require('fs');http.createServer(function \n (req, res) {  fs.readFile('demofile1.html', function(err, data) {\n    \n res.writeHead(200, {'Content-Type': 'text/html'});    res.write(data);    \n return res.end();  });}).listen(8080);\nRun example »\n\nSave the code above in a file called \"demo_readfile.js\", and initiate the \nfile:\n\nInitiate demo_readfile.js:\n\nC:\\Users\\Your Name>node demo_readfile.js\n\n\nIf you have followed the same steps on your computer, you will see the same \nresult as the example: http://localhost:8080\n\n\n\n\n\n\nCreate Files\nThe File System module has methods for creating new files:\n\nfs.appendFile()\nfs.open()\nfs.writeFile()\n\nThe fs.appendFile() method appends specified content to a file. If the \nfile does not exist, the file will be created:\n\nExample\nCreate a new file using the appendFile() method:\n\n var fs = require('fs');fs.appendFile('mynewfile1.txt', 'Hello \n content!', function (err) {  if (err) throw err;  console.log('Saved!');\n });\nRun example »\n\nThe fs.open() method takes a \"flag\" as the second argument, if the \nflag is \"w\" for \"writing\", the specified file is opened for writing. If the file \ndoes not exist, an empty file is created:\n\nExample\nCreate a new, empty file using the open() method:\n\n var fs = require('fs');fs.open('mynewfile2.txt', 'w', function (err, \n file) {  if (err) throw err;  console.log('Saved!');});\nRun example »\n\nThe fs.writeFile() method replaces the specified file and content if it exists. \nIf the file does not exist, a new file, containing the specified content, will \nbe created:\n\nExample\nCreate a new file using the writeFile() method:\n\n var fs = require('fs');fs.writeFile('mynewfile3.txt', 'Hello \n content!', function (err) {  if (err) throw err;  \n console.log('Saved!');});\nRun example »\n\n\nUpdate Files\nThe File System module has methods for updating files:\n\nfs.appendFile()\nfs.writeFile()\n\nThe fs.appendFile() method appends the specified content at the end of the specified file:\n\nExample\nAppend \"This is my text.\" to the end of the file \"mynewfile1.txt\":\n\n var fs = require('fs');fs.appendFile('mynewfile1.txt', ' This is my \n text.', function (err) {  if (err) throw err;  console.log('Updated!');\n });\nRun example »\n\nThe fs.writeFile() method replaces the specified file and content:\n\nExample\nReplace the content of the file \"mynewfile3.txt\":\n\n var fs = require('fs');fs.writeFile('mynewfile3.txt', 'This is my text', function (err) {  if (err) throw err;  \n console.log('Replaced!');});\nRun example »\n\n\nDelete Files\nTo delete a file with the File System module,  use the fs.unlink() \nmethod.\nThe fs.unlink() method deletes the specified file:\n\nExample\nDelete \"mynewfile2.txt\":\n\n var fs = require('fs');fs.unlink('mynewfile2.txt', function (err) {  \n if (err) throw err;  console.log('File deleted!');});\nRun example »\n\n\nRename Files\nTo rename a file with the File System module,  use the fs.rename() \nmethod.\nThe fs.rename() method renames the specified file:\n\nExample\nRename \"mynewfile1.txt\" to \"myrenamedfile.txt\":\n\n var fs = require('fs');fs.rename('mynewfile1.txt', 'myrenamedfile.txt', function (err) {  \n if (err) throw err;  console.log('File Renamed!');});\nRun example »\n\n\nUpload Files\nYou can also use Node.js to upload files to your computer.\nRead how in our Node.js Upload Files chapter.\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var fs = require('fs');" + }, + { + "language": "javascript", + "code": "

My Header

My paragraph.

\n " + }, + { + "language": "javascript", + "code": "var http = require('http');var fs = require('fs');http.createServer(function \n (req, res) {  fs.readFile('demofile1.html', function(err, data) {\n    \n res.writeHead(200, {'Content-Type': 'text/html'});    res.write(data);    \n return res.end();  });}).listen(8080);" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_readfile.js" + }, + { + "language": "javascript", + "code": "var fs = require('fs');fs.appendFile('mynewfile1.txt', 'Hello \n content!', function (err) {  if (err) throw err;  console.log('Saved!');\n });" + }, + { + "language": "javascript", + "code": "var fs = require('fs');fs.open('mynewfile2.txt', 'w', function (err, \n file) {  if (err) throw err;  console.log('Saved!');});" + }, + { + "language": "javascript", + "code": "var fs = require('fs');fs.writeFile('mynewfile3.txt', 'Hello \n content!', function (err) {  if (err) throw err;  \n console.log('Saved!');});" + }, + { + "language": "javascript", + "code": "var fs = require('fs');fs.appendFile('mynewfile1.txt', ' This is my \n text.', function (err) {  if (err) throw err;  console.log('Updated!');\n });" + }, + { + "language": "javascript", + "code": "var fs = require('fs');fs.writeFile('mynewfile3.txt', 'This is my text', function (err) {  if (err) throw err;  \n console.log('Replaced!');});" + }, + { + "language": "javascript", + "code": "var fs = require('fs');fs.unlink('mynewfile2.txt', function (err) {  \n if (err) throw err;  console.log('File deleted!');});" + }, + { + "language": "javascript", + "code": "var fs = require('fs');fs.rename('mynewfile1.txt', 'myrenamedfile.txt', function (err) {  \n if (err) throw err;  console.log('File Renamed!');});" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_url.asp", + "content": "Node.js URL Module\n\n❮ Previous\nNext ❯\n\n\nThe Built-in URL Module\nThe URL module splits up a web address into readable parts.\nTo include the URL module, use the require() \nmethod:\n\n\n var url = require('url');\n\nParse an address with the url.parse() \nmethod, and it will return a URL object with each part of the address as \nproperties:\n\nExample\nSplit a web address into readable parts:\n\n var url = require('url');\n var adr = 'http://localhost:8080/default.htm?year=2017&month=february';\n var q = url.parse(adr, true);\n console.log(q.host); //returns 'localhost:8080'\n console.log(q.pathname); //returns '/default.htm'console.log(q.search); //returns '?year=2017&month=february'\n var qdata = q.query; //returns an object: { year: 2017, month: 'february' }\n console.log(qdata.month); //returns 'february'\n\nRun example »\n\n\nNode.js File Server\nNow we know how to parse the query string, and in the previous chapter we \nlearned how to make Node.js behave as a file \nserver. Let us combine the two, and serve the file requested by the client.\nCreate two html files and save them in the same folder as your node.js files.\n\nsummer.html\n\n

Summer

I love \n the sun!

\n \n\n\nwinter.html\n\n

Winter

I love \n the snow!

\n \n\n\n\n\n\n\n\nCreate a Node.js file that opens the requested file and returns the content \nto the client. If anything goes wrong, throw a 404 error:\n\ndemo_fileserver.js:\n\n var http = require('http');var url = require('url');var fs = require('fs');\nhttp.createServer(function \n (req, res) {  var q = url.parse(req.url, true);  var \n filename = \".\" + q.pathname;  fs.readFile(filename, \n function(err, data) {    if (err) {      res.writeHead(404, {'Content-Type': 'text/html'});      \n return res.end(\"404 Not Found\");    }      res.writeHead(200, {'Content-Type': 'text/html'});    res.write(data);    \n return res.end();  });}).listen(8080);\n\nRemember to initiate the file:\n\nInitiate demo_fileserver.js:\n\nC:\\Users\\Your Name>node demo_fileserver.js\n\n\nIf you have followed the same steps on your computer, you should see two \ndifferent results when opening these two addresses:\nhttp://localhost:8080/summer.html\n\nWill produce this result:\n\nSummer\nI love the sun!\n\n\nhttp://localhost:8080/winter.html\n\nWill produce this result:\n\nWinter\nI love the snow!\n\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var url = require('url');" + }, + { + "language": "javascript", + "code": "var url = require('url');\n var adr = 'http://localhost:8080/default.htm?year=2017&month=february';\n var q = url.parse(adr, true);\n console.log(q.host); //returns 'localhost:8080'\n console.log(q.pathname); //returns '/default.htm'console.log(q.search); //returns '?year=2017&month=february'\n var qdata = q.query; //returns an object: { year: 2017, month: 'february' }\n console.log(qdata.month); //returns 'february'" + }, + { + "language": "javascript", + "code": "

Summer

I love \n the sun!

\n " + }, + { + "language": "javascript", + "code": "

Winter

I love \n the snow!

\n " + }, + { + "language": "javascript", + "code": "var http = require('http');var url = require('url');var fs = require('fs');\nhttp.createServer(function \n (req, res) {  var q = url.parse(req.url, true);  var \n filename = \".\" + q.pathname;  fs.readFile(filename, \n function(err, data) {    if (err) {      res.writeHead(404, {'Content-Type': 'text/html'});      \n return res.end(\"404 Not Found\");    }      res.writeHead(200, {'Content-Type': 'text/html'});    res.write(data);    \n return res.end();  });}).listen(8080);" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_fileserver.js" + }, + { + "language": "javascript", + "code": "Summer\nI love the sun!" + }, + { + "language": "javascript", + "code": "Winter\nI love the snow!" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_npm.asp", + "content": "Node.js NPM\n\n❮ Previous\nNext ❯\n\n\nWhat is NPM?\nNPM is a package manager for Node.js packages, or modules if you like.\nwww.npmjs.com hosts thousands of \nfree packages to download and use.\nThe NPM program is installed on your computer when you install Node.js\n\nNPM is already ready to run on your computer!\n\n\nWhat is a Package?\nA package in Node.js contains all the files you need for a module.\nModules are JavaScript libraries you can include in your project.\n\nDownload a Package\nDownloading a package is very easy.\nOpen the command line interface and tell NPM to download the package you want.\nI want to download a package called \"upper-case\":\n\nDownload \"upper-case\":\n\nC:\\Users\\Your Name>npm install upper-case\n\n\nNow you have downloaded and installed your first package!\nNPM creates a folder named \"node_modules\", where the package will be placed. \nAll packages you install in the future will be \nplaced in this folder.\nMy project now has a folder structure like this:\nC:\\Users\\My Name\\node_modules\\upper-case\n\n\n\n\n\n\nUsing a Package\nOnce the package is installed, it is ready to use.\nInclude the \"upper-case\" package the same way you include any other \nmodule:\n\n\n var uc = require('upper-case');\n\nCreate a Node.js file that will convert the output \"Hello World!\" into upper-case letters:\n\nExample\n\n var http = require('http');var uc = require('upper-case');http.createServer(function \n (req, res) {  res.writeHead(200, {'Content-Type': 'text/html'});\n   res.write(uc.upperCase(\"Hello \n World!\"));  \n res.end();}).listen(8080);\nRun example »\n\nSave the code above in a file called \"demo_uppercase.js\", and initiate the file:\n\nInitiate demo_uppercase:\n\nC:\\Users\\Your Name>node demo_uppercase.js\n\n\nIf you have followed the same steps on your computer, you will see the same result as the example: http://localhost:8080\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "C:\\Users\\Your Name>npm install upper-case" + }, + { + "language": "javascript", + "code": "var uc = require('upper-case');" + }, + { + "language": "javascript", + "code": "var http = require('http');var uc = require('upper-case');http.createServer(function \n (req, res) {  res.writeHead(200, {'Content-Type': 'text/html'});\n   res.write(uc.upperCase(\"Hello \n World!\"));  \n res.end();}).listen(8080);" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_uppercase.js" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_events.asp", + "content": "Node.js Events\n\n❮ Previous\nNext ❯\n\n\nNode.js is perfect for event-driven applications.\n\nEvents in Node.js\nEvery action on a computer is an event. Like when a connection is made or a \nfile is opened.\nObjects in Node.js can fire events, like the readStream object fires \nevents when opening and closing a file:\n\nExample\n\n var fs = require('fs');var rs = fs.createReadStream('./demofile.txt');\n rs.on('open', function () {  console.log('The file is open');\n });\nRun example »\n\n\nEvents Module\nNode.js has a \nbuilt-in module, called \"Events\", where you can create-, fire-, and listen for- your own \nevents.\nTo include the built-in Events module use the require() \nmethod. In addition, all event properties and methods are an instance of an \nEventEmitter object. To be able to access these properties and methods, create \nan EventEmitter object:\n\n\n var events = require('events');var eventEmitter = new events.EventEmitter();\n\n\nThe EventEmitter Object\nYou can assign event handlers to your own events with the EventEmitter \nobject.\nIn the example below we have created a function that will be \nexecuted when a \"scream\" event is fired.\nTo fire an event, use the emit() method.\n\nExample\n\n var events = require('events');var eventEmitter = new events.EventEmitter();\n//Create an event handler:var myEventHandler = function () {  \n console.log('I hear a scream!');}//Assign the event handler to an \n event:eventEmitter.on('scream', myEventHandler);//Fire the \n 'scream' event:eventEmitter.emit('scream');\nRun example »\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var fs = require('fs');var rs = fs.createReadStream('./demofile.txt');\n rs.on('open', function () {  console.log('The file is open');\n });" + }, + { + "language": "javascript", + "code": "var events = require('events');var eventEmitter = new events.EventEmitter();" + }, + { + "language": "javascript", + "code": "var events = require('events');var eventEmitter = new events.EventEmitter();\n//Create an event handler:var myEventHandler = function () {  \n console.log('I hear a scream!');}//Assign the event handler to an \n event:eventEmitter.on('scream', myEventHandler);//Fire the \n 'scream' event:eventEmitter.emit('scream');" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_uploadfiles.asp", + "content": "Node.js Upload Files\n\n❮ Previous\nNext ❯\n\n\nThe Formidable Module\nThere is a very good module for working with file uploads, called \"Formidable\".\nThe Formidable module can be downloaded and installed using NPM:\n\n\nC:\\Users\\Your Name>npm install formidable\n\nAfter you have downloaded the Formidable module, you can include the module \nin any application:\n\n\n var formidable = require('formidable');\n\n\nUpload Files\nNow you are ready to make a web page in Node.js that lets the user upload \nfiles to your computer:\nStep 1: Create an Upload Form\nCreate a Node.js file that writes an HTML form, with an upload field:\n\nExample\nThis code will produce an HTML form:\n\n var http = require('http');http.createServer(function \n (req, res) {  res.writeHead(200, {'Content-Type': 'text/html'});  res.write('
');  res.write('
');  res.write('');  res.write('
');  \n return res.end();}).listen(8080);\n\nStep 2: Parse the Uploaded File\nInclude the Formidable module to be able to parse the uploaded file once it \nreaches the server.\nWhen the file is uploaded and parsed, it gets placed on a temporary folder on your computer.\n\nExample\nThe file will be uploaded, and placed on a temporary folder:\n\n var http = require('http');var formidable = require('formidable');\nhttp.createServer(function \n (req, res) {  if (req.url == '/fileupload') {    \n var form = new formidable.IncomingForm();    form.parse(req, \n function (err, fields, files) {      res.write('File \n uploaded');      res.end();    });\n  \n } else {    res.writeHead(200, {'Content-Type': 'text/html'});    res.write('
');    res.write('
');    res.write('');    res.write('
');    \n return res.end();  }}).listen(8080);\n\n\n\n\n\n\n\nStep 3: Save the File\nWhen a file is successfully uploaded to the server, it is placed on a \ntemporary folder.\nThe path to this directory can be found in the \"files\" object, passed as the \nthird argument in the parse() method's callback function.\nTo move the file to the folder of your choice, use the File System module, \nand rename the file:\n\nExample\nInclude the fs module, and move the file to the current folder:\n\n var http = require('http');var formidable = require('formidable');\nvar fs = require('fs');http.createServer(function \n (req, res) {  if (req.url == '/fileupload') {    \n var form = new formidable.IncomingForm();    form.parse(req, \n function (err, fields, files) {      var \n oldpath = files.filetoupload.filepath;      var \n newpath = 'C:/Users/Your Name/' + files.filetoupload.originalFilename;      \n fs.rename(oldpath, newpath, function (err) {        if (err) throw \n err;        res.write('File uploaded \n and moved!');        res.end();      \n }); });  \n } else {    res.writeHead(200, {'Content-Type': 'text/html'});    res.write('
');    res.write('
');    res.write('');    res.write('
');    \n return res.end();  }}).listen(8080);\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "C:\\Users\\Your Name>npm install formidable" + }, + { + "language": "javascript", + "code": "var formidable = require('formidable');" + }, + { + "language": "javascript", + "code": "var http = require('http');http.createServer(function \n (req, res) {  res.writeHead(200, {'Content-Type': 'text/html'});  res.write('
');  res.write('
');  res.write('');  res.write('
');  \n return res.end();}).listen(8080);" + }, + { + "language": "javascript", + "code": "var http = require('http');var formidable = require('formidable');\nhttp.createServer(function \n (req, res) {  if (req.url == '/fileupload') {    \n var form = new formidable.IncomingForm();    form.parse(req, \n function (err, fields, files) {      res.write('File \n uploaded');      res.end();    });\n  \n } else {    res.writeHead(200, {'Content-Type': 'text/html'});    res.write('
');    res.write('
');    res.write('');    res.write('
');    \n return res.end();  }}).listen(8080);" + }, + { + "language": "javascript", + "code": "var http = require('http');var formidable = require('formidable');\nvar fs = require('fs');http.createServer(function \n (req, res) {  if (req.url == '/fileupload') {    \n var form = new formidable.IncomingForm();    form.parse(req, \n function (err, fields, files) {      var \n oldpath = files.filetoupload.filepath;      var \n newpath = 'C:/Users/Your Name/' + files.filetoupload.originalFilename;      \n fs.rename(oldpath, newpath, function (err) {        if (err) throw \n err;        res.write('File uploaded \n and moved!');        res.end();      \n }); });  \n } else {    res.writeHead(200, {'Content-Type': 'text/html'});    res.write('
');    res.write('
');    res.write('');    res.write('
');    \n return res.end();  }}).listen(8080);" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_email.asp", + "content": "Node.js Send an Email\n\n❮ Previous\nNext ❯\n\n\nThe Nodemailer Module\nThe Nodemailer module makes it easy to send emails from your computer.\nThe Nodemailer module can be downloaded and installed using npm:\n\n\nC:\\Users\\Your Name>npm install nodemailer\n\nAfter you have downloaded the Nodemailer module, you can include the module \nin any application:\n\n\n var nodemailer = require('nodemailer');\n\n\nSend an Email\nNow you are ready to send emails from your server.\nUse the username and password from your selected email provider to send an \nemail. This tutorial will show you how to use your Gmail account to send an \nemail:\n\nExample\n\n var nodemailer = require('nodemailer');var transporter = \n nodemailer.createTransport({  service: 'gmail',  auth: {    \n user: 'youremail@gmail.com',    \n pass: 'yourpassword'  }});var mailOptions = {  \n from: 'youremail@gmail.com',  \n to: 'myfriend@yahoo.com',  subject: 'Sending Email using Node.js',  text: \n 'That was easy!'};transporter.sendMail(mailOptions, \n function(error, info){  if (error) {    console.log(error);  } else {\n    \n console.log('Email sent: ' + info.response);  }});\n\nAnd that's it! Now your server is able to send emails.\n\n\n\n\n\n\nMultiple Receivers\nTo send an email to more than one receiver, add them to the \"to\" property of the mailOptions object, separated by commas:\n\nExample\nSend email to more than one address:\n\n var mailOptions = {  \n from: 'youremail@gmail.com',  \n to: 'myfriend@yahoo.com, \nmyotherfriend@yahoo.com',\n  subject: 'Sending Email using Node.js',  text: \n'That was easy!'}\n\n\nSend HTML\nTo send HTML formatted text in your email, use the \"html\" property instead of \nthe \"text\" property:\n\nExample\nSend email containing HTML:\n\n var mailOptions = {  \n from: 'youremail@gmail.com',  \n to: 'myfriend@yahoo.com',\n  subject: 'Sending Email using Node.js',  html: \n'

Welcome

That was easy!

'}\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "C:\\Users\\Your Name>npm install nodemailer" + }, + { + "language": "javascript", + "code": "var nodemailer = require('nodemailer');" + }, + { + "language": "javascript", + "code": "var nodemailer = require('nodemailer');var transporter = \n nodemailer.createTransport({  service: 'gmail',  auth: {    \n user: 'youremail@gmail.com',    \n pass: 'yourpassword'  }});var mailOptions = {  \n from: 'youremail@gmail.com',  \n to: 'myfriend@yahoo.com',  subject: 'Sending Email using Node.js',  text: \n 'That was easy!'};transporter.sendMail(mailOptions, \n function(error, info){  if (error) {    console.log(error);  } else {\n    \n console.log('Email sent: ' + info.response);  }});" + }, + { + "language": "javascript", + "code": "var mailOptions = {  \n from: 'youremail@gmail.com',  \n to: 'myfriend@yahoo.com, \nmyotherfriend@yahoo.com',\n  subject: 'Sending Email using Node.js',  text: \n'That was easy!'}" + }, + { + "language": "javascript", + "code": "var mailOptions = {  \n from: 'youremail@gmail.com',  \n to: 'myfriend@yahoo.com',\n  subject: 'Sending Email using Node.js',  html: \n'

Welcome

That was easy!

'}" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql.asp", + "content": "Node.js MySQL\n\n❮ Previous\nNext ❯\n\n\nNode.js can be used in database applications.\nOne of the most popular databases is MySQL.\n\nMySQL Database\nTo be able to experiment with the code examples, you should have MySQL installed \non your computer.\nYou can download a free MySQL database at https://www.mysql.com/downloads/.\n\nInstall MySQL Driver\nOnce you have MySQL up and running on your computer, you can access it by \nusing Node.js.\nTo access a MySQL database with Node.js, you need a MySQL driver. This \ntutorial will use the \"mysql\" module, downloaded from NPM.\nTo download and install the \"mysql\" module, open the Command Terminal and execute the following:\n\n\nC:\\Users\\Your Name>npm install mysql\n\n\nNow you have downloaded and installed a mysql database driver.\nNode.js can use this module to manipulate the MySQL database:\n\n\n var mysql = require('mysql');\n\n\n\n\n\n\n\nCreate Connection\nStart by creating a connection to the database.\nUse the username and password from your MySQL database.\n\ndemo_db_connection.js\n\n var mysql = require('mysql');var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  password: \"yourpassword\"\n });con.connect(function(err) {  if (err) throw err;  console.log(\"Connected!\");});\nRun example »\n\nSave the code above in a file called \"demo_db_connection.js\" and run the file:\n\nRun \"demo_db_connection.js\"\n\nC:\\Users\\Your Name>node demo_db_connection.js\n\n\nWhich will give you this result:\n\n\nConnected!\n\nNow you can start querying the database using SQL statements.\n\nQuery a Database\nUse SQL statements to read from (or write to) a MySQL database. This \nis also called \"to query\" the database.\nThe connection object created in the example above, has a method for querying the database:\n\n\n con.connect(function(err) {  if (err) throw err;  console.log(\"Connected!\");\n \n con.query(sql, function (err, result) {    if (err) throw err;    console.log(\"Result: \n \" + result);  });});\n\nThe query method takes an sql statements as a parameter and returns the \nresult.\nLearn how to read, write, delete, and update a database in the next chapters.\nRead more about SQL statements in our SQL Tutorial.\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "C:\\Users\\Your Name>npm install mysql" + }, + { + "language": "javascript", + "code": "var mysql = require('mysql');" + }, + { + "language": "javascript", + "code": "var mysql = require('mysql');var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  password: \"yourpassword\"\n });con.connect(function(err) {  if (err) throw err;  console.log(\"Connected!\");});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_connection.js" + }, + { + "language": "javascript", + "code": "Connected!" + }, + { + "language": "javascript", + "code": "con.connect(function(err) {  if (err) throw err;  console.log(\"Connected!\");\n \n con.query(sql, function (err, result) {    if (err) throw err;    console.log(\"Result: \n \" + result);  });});" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_create_db.asp", + "content": "Node.js MySQL Create Database\n\n❮ Previous\nNext ❯\n\n\nCreating a Database\nTo create a database in MySQL, use the \"CREATE DATABASE\" statement:\n\nExample\nCreate a database named \"mydb\":\n\n var mysql = require('mysql');var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  password: \"yourpassword\"\n });con.connect(function(err) {  if (err) throw err;  console.log(\"Connected!\");  \n con.query(\"CREATE DATABASE mydb\", function (err, result) {\n     if (err) throw err;    console.log(\"Database \n created\");  });});\nRun example »\n\nSave the code above in a file called \"demo_create_db.js\" and run the file:\n\nRun \"demo_create_db.js\"\n\nC:\\Users\\Your Name>node demo_create_db.js\n\n\nWhich will give you this result:\n\n\nConnected!Database created\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var mysql = require('mysql');var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  password: \"yourpassword\"\n });con.connect(function(err) {  if (err) throw err;  console.log(\"Connected!\");  \n con.query(\"CREATE DATABASE mydb\", function (err, result) {\n     if (err) throw err;    console.log(\"Database \n created\");  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_create_db.js" + }, + { + "language": "javascript", + "code": "Connected!Database created" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_create_table.asp", + "content": "Node.js MySQL Create Table\n\n❮ Previous\nNext ❯\n\n\nCreating a Table\nTo create a table in MySQL, use the \"CREATE TABLE\" statement.\nMake sure you define the name of the database when you create the connection:\n\nExample\nCreate a table named \"customers\":\n\n var mysql = require('mysql');var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  password: \"yourpassword\",\n  database: \"mydb\"\n });con.connect(function(err) {  if (err) throw err;  console.log(\"Connected!\");  \n var sql = \"CREATE TABLE customers (name VARCHAR(255), \n address VARCHAR(255))\";  \n con.query(sql, function (err, result) {    if (err) \n throw err;    console.log(\"Table created\");  });});\nRun example »\n\nSave the code above in a file called \"demo_create_table.js\" and run the file:\n\nRun \"demo_create_table.js\"\n\nC:\\Users\\Your Name>node demo_create_table.js\n\n\nWhich will give you this result:\n\n\nConnected!Table created\n\n\n\n\n\n\n\nPrimary Key\nWhen creating a table, you should also create a column with a unique key for each \nrecord.\nThis can be done by defining a column as \"INT AUTO_INCREMENT PRIMARY KEY\" which will insert a \nunique number for each record. Starting at 1, and increased by one for each \nrecord.\n\nExample\nCreate primary key when creating the table:\n\n var mysql = require('mysql');var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  password: \"yourpassword\",\n   database: \"mydb\"\n });con.connect(function(err) {  if (err) throw err;  console.log(\"Connected!\");  \n var sql = \"CREATE TABLE customers (id INT AUTO_INCREMENT PRIMARY \n KEY, name VARCHAR(255), \n address VARCHAR(255))\";  \n con.query(sql, function (err, result) {    if (err) \n throw err;    console.log(\"Table created\");  });});\nRun example »\n\nIf the table already exists, use the ALTER TABLE keyword:\n\nExample\nCreate primary key on an existing table:\n\n var mysql = require('mysql');var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  password: \"yourpassword\",\n   database: \"mydb\"\n });con.connect(function(err) {  if (err) throw err;  console.log(\"Connected!\");  \n var sql = \"ALTER TABLE customers ADD COLUMN id INT AUTO_INCREMENT \n PRIMARY KEY\";  \n con.query(sql, function (err, result) {    if (err) \n throw err;    console.log(\"Table altered\");  });});\nRun example »\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var mysql = require('mysql');var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  password: \"yourpassword\",\n  database: \"mydb\"\n });con.connect(function(err) {  if (err) throw err;  console.log(\"Connected!\");  \n var sql = \"CREATE TABLE customers (name VARCHAR(255), \n address VARCHAR(255))\";  \n con.query(sql, function (err, result) {    if (err) \n throw err;    console.log(\"Table created\");  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_create_table.js" + }, + { + "language": "javascript", + "code": "Connected!Table created" + }, + { + "language": "javascript", + "code": "var mysql = require('mysql');var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  password: \"yourpassword\",\n   database: \"mydb\"\n });con.connect(function(err) {  if (err) throw err;  console.log(\"Connected!\");  \n var sql = \"CREATE TABLE customers (id INT AUTO_INCREMENT PRIMARY \n KEY, name VARCHAR(255), \n address VARCHAR(255))\";  \n con.query(sql, function (err, result) {    if (err) \n throw err;    console.log(\"Table created\");  });});" + }, + { + "language": "javascript", + "code": "var mysql = require('mysql');var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  password: \"yourpassword\",\n   database: \"mydb\"\n });con.connect(function(err) {  if (err) throw err;  console.log(\"Connected!\");  \n var sql = \"ALTER TABLE customers ADD COLUMN id INT AUTO_INCREMENT \n PRIMARY KEY\";  \n con.query(sql, function (err, result) {    if (err) \n throw err;    console.log(\"Table altered\");  });});" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_insert.asp", + "content": "Node.js MySQL Insert Into\n\n❮ Previous\nNext ❯\n\n\nInsert Into Table\nTo fill a table in MySQL, use the \"INSERT INTO\" statement.\n\nExample\nInsert a record in the \"customers\" table:\n\n var mysql = require('mysql');var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  password: \"yourpassword\",\n   database: \"mydb\"\n });con.connect(function(err) {  if (err) throw err;  console.log(\"Connected!\");\n  var sql = \"INSERT INTO customers (name, address) \n VALUES ('Company Inc', 'Highway 37')\";  \n con.query(sql, function (err, result) {    if (err) throw err;    console.log(\"1 record inserted\");  });});\nRun example »\n\nSave the code above in a file called \"demo_db_insert.js\", and run the file:\n\nRun \"demo_db_insert.js\"\n\nC:\\Users\\Your Name>node demo_db_insert.js\n\n\nWhich will give you this result:\n\n\nConnected!1 record inserted\n\n\n\n\n\n\n\nInsert Multiple Records\nTo insert more than one record, make an array containing the values, and \ninsert a question mark in the sql, which will be replaced by the value array:\nINSERT INTO customers (name, address) VALUES ?\n\nExample\nFill the \"customers\" table with data:\n\n var mysql = require('mysql');var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\n con.connect(function(err) {  if (err) throw err;  \n console.log(\"Connected!\");  var sql = \"INSERT INTO customers (name, \n address) VALUES ?\";  var values = [    ['John', \n 'Highway 71'],    ['Peter', 'Lowstreet 4'],    \n ['Amy', 'Apple st 652'],    ['Hannah', 'Mountain 21'],    \n ['Michael', 'Valley 345'],    ['Sandy', 'Ocean blvd 2'],    \n ['Betty', 'Green Grass 1'],    ['Richard', 'Sky st 331'],    \n ['Susan', 'One way 98'],    ['Vicky', 'Yellow Garden 2'],    \n ['Ben', 'Park Lane 38'],    ['William', 'Central st 954'],    \n ['Chuck', 'Main Road 989'],    ['Viola', 'Sideway 1633']  \n ];  con.query(sql, [values], function (err, result) \n {    if (err) throw err;    console.log(\"Number \n of records inserted: \" + result.affectedRows);  });});\nRun example »\n\nSave the code above in a file called \"demo_db_insert_multple.js\", and run the file:\n\nRun \"demo_db_insert_multiple.js\"\n\nC:\\Users\\Your Name>node demo_db_insert_multiple.js\n\n\nWhich will give you this result:\n\n\nConnected!Number of records inserted: 14\n\n\nThe Result Object\nWhen executing a query, a result object is returned.\nThe result object contains information about how the query \naffected the table.\nThe result object returned from the example above looks like this:\n\n\n {  fieldCount: 0,  affectedRows: 14,  insertId: 0,  \n serverStatus: 2,  warningCount: 0,  message: '\\'Records:14  \n Duplicated: 0  Warnings: 0',  protocol41: true,  \n changedRows: 0}\n\nThe values of the properties can be displayed like this:\n\nExample\nReturn the number of affected rows:\n\nconsole.log(result.affectedRows)\n\n\nWhich will produce this result:\n\n\n14\n\n\nGet Inserted ID\nFor tables with an auto increment id field, you can get the id of the row you \njust inserted by asking the result object.\n\nNote: To be able to get the inserted id, only one row can be inserted.\n\n\nExample\nInsert a record in the \"customers\" table, and return the ID:\n\n var mysql = require('mysql');var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  password: \"yourpassword\",\n   database: \"mydb\"\n });con.connect(function(err) {  if (err) throw err;  var sql = \"INSERT INTO customers (name, address) \n VALUES ('Michelle', 'Blue Village 1')\";  \n con.query(sql, function (err, result) {    if (err) throw err;    console.log(\"1 record inserted, \n ID: \" + result.insertId);  });});\nRun example »\n\nSave the code above in a file called \"demo_db_insert_id.js\", and run the file:\n\nRun \"demo_db_insert_id.js\"\n\nC:\\Users\\Your Name>node demo_db_insert_id.js\n\n\nWhich will give you something like this in return:\n\n\n 1 record inserted, ID: 15\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var mysql = require('mysql');var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  password: \"yourpassword\",\n   database: \"mydb\"\n });con.connect(function(err) {  if (err) throw err;  console.log(\"Connected!\");\n  var sql = \"INSERT INTO customers (name, address) \n VALUES ('Company Inc', 'Highway 37')\";  \n con.query(sql, function (err, result) {    if (err) throw err;    console.log(\"1 record inserted\");  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_insert.js" + }, + { + "language": "javascript", + "code": "Connected!1 record inserted" + }, + { + "language": "javascript", + "code": "var mysql = require('mysql');var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\n con.connect(function(err) {  if (err) throw err;  \n console.log(\"Connected!\");  var sql = \"INSERT INTO customers (name, \n address) VALUES ?\";  var values = [    ['John', \n 'Highway 71'],    ['Peter', 'Lowstreet 4'],    \n ['Amy', 'Apple st 652'],    ['Hannah', 'Mountain 21'],    \n ['Michael', 'Valley 345'],    ['Sandy', 'Ocean blvd 2'],    \n ['Betty', 'Green Grass 1'],    ['Richard', 'Sky st 331'],    \n ['Susan', 'One way 98'],    ['Vicky', 'Yellow Garden 2'],    \n ['Ben', 'Park Lane 38'],    ['William', 'Central st 954'],    \n ['Chuck', 'Main Road 989'],    ['Viola', 'Sideway 1633']  \n ];  con.query(sql, [values], function (err, result) \n {    if (err) throw err;    console.log(\"Number \n of records inserted: \" + result.affectedRows);  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_insert_multiple.js" + }, + { + "language": "javascript", + "code": "Connected!Number of records inserted: 14" + }, + { + "language": "javascript", + "code": "{  fieldCount: 0,  affectedRows: 14,  insertId: 0,  \n serverStatus: 2,  warningCount: 0,  message: '\\'Records:14  \n Duplicated: 0  Warnings: 0',  protocol41: true,  \n changedRows: 0}" + }, + { + "language": "javascript", + "code": "console.log(result.affectedRows)" + }, + { + "language": "javascript", + "code": "14" + }, + { + "language": "javascript", + "code": "var mysql = require('mysql');var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  password: \"yourpassword\",\n   database: \"mydb\"\n });con.connect(function(err) {  if (err) throw err;  var sql = \"INSERT INTO customers (name, address) \n VALUES ('Michelle', 'Blue Village 1')\";  \n con.query(sql, function (err, result) {    if (err) throw err;    console.log(\"1 record inserted, \n ID: \" + result.insertId);  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_insert_id.js" + }, + { + "language": "javascript", + "code": "1 record inserted, ID: 15" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_select.asp", + "content": "Node.js MySQL Select From\n\n❮ Previous\nNext ❯\n\n\nSelecting From a Table\nTo select data from a table in MySQL, use the \"SELECT\" statement.\n\nExample\nSelect all records from the \"customers\" table, and display the result object:\n\n var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n con.query(\"SELECT * FROM customers\", function (err, result, fields) {    \n if (err) throw err;    console.log(result);  });\n });\nRun example »\n\n\nSELECT * will return all columns\n\nSave the code above in a file called \"demo_db_select.js\" and run the file:\n\nRun \"demo_db_select.js\"\n\nC:\\Users\\Your Name>node demo_db_select.js\n\n\nWhich will give you this result:\n\n\n [  { id: 1, name: 'John', address: 'Highway 71'},  { id: \n 2, name: 'Peter', address: 'Lowstreet 4'},  { id: 3, name: 'Amy', \n address: 'Apple st 652'},  { id: 4, name: 'Hannah', address: \n 'Mountain 21'},  { id: 5, name: 'Michael', address: 'Valley 345'},  \n { id: 6, name: 'Sandy', address: 'Ocean blvd 2'},  { id: 7, \n name: 'Betty', address: 'Green Grass 1'},  { id: 8, name: 'Richard', \n address: 'Sky st 331'},  { id: 9, name: 'Susan', address: 'One way \n 98'},  { id: 10, name: 'Vicky', address: 'Yellow Garden 2'},  \n { id: 11, name: 'Ben', address: 'Park Lane 38'},  { id: 12, name: 'William', \n address: 'Central st 954'},  { id: 13, name: 'Chuck', address: \n 'Main Road 989'},  { id: 14, name: 'Viola', address: 'Sideway \n 1633'}]\n\n\n\n\n\n\n\nSelecting Columns\nTo select only some of the columns in a table, use the \"SELECT\" statement followed by the column name.\n\nExample\nSelect name and address from the \"customers\" table, and display the return object:\n\n var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n con.query(\"SELECT name, address FROM customers\", function (err, result, fields) {    \n if (err) throw err;    console.log(result);  });\n });\nRun example »\n\nSave the code above in a file called \"demo_db_select2.js\" and run the file:\n\nRun \"demo_db_select2.js\"\n\nC:\\Users\\Your Name>node demo_db_select2.js\n\n\nWhich will give you this result:\n\n\n [  { name: 'John', address: 'Highway 71'},  { name: 'Peter', address: 'Lowstreet 4'},  { name: 'Amy', \n address: 'Apple st 652'},  { name: 'Hannah', address: \n 'Mountain 21'},  { name: 'Michael', address: 'Valley 345'},  \n { name: 'Sandy', address: 'Ocean blvd 2'},  { \n name: 'Betty', address: 'Green Grass 1'},  { name: 'Richard', \n address: 'Sky st 331'},  { name: 'Susan', address: 'One way \n 98'},  { name: 'Vicky', address: 'Yellow Garden 2'},  \n { name: 'Ben', address: 'Park Lane 38'},  { name: 'William', \n address: 'Central st 954'},  { name: 'Chuck', address: \n 'Main Road 989'},  { name: 'Viola', address: 'Sideway \n 1633'}]\n\n\nThe Result Object\nAs you can see from the result of the example above, the result object is an \narray containing each row as an object.\nTo return e.g. the address of the third record, just refer to the third array \nobject's address property:\n\nExample\nReturn the address of the third record:\n\n console.log(result[2].address);\n\nWhich will produce this result:\n\n\n Apple st 652\n\n\nThe Fields Object\nThe third parameter of the callback function is an array containing \ninformation about each field in the result.\n\nExample\nSelect all records from the \"customers\" table, and display the fields object:\n\n var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n con.query(\"SELECT name, address FROM customers\", function (err, \n result, fields) {    \n if (err) throw err;    console.log(fields);  });\n });\nRun example »\n\nSave the code above in a file called \"demo_db_select_fields.js\" and run the file:\n\nRun \"demo_db_select_fields.js\"\n\nC:\\Users\\Your Name>node demo_db_select_fields.js\n\n\nWhich will give you this result:\n\n\n [  {    catalog: 'def',    db: \n 'mydb',    table: 'customers',    \n orgTable: 'customers',    name: 'name',    \n orgName: 'name',    charsetNr: 33,    \n length: 765,    type: 253,    flags: 0,    \n decimals: 0,    default: undefined,    \n zeroFill: false,    protocol41: true  },  {    catalog: 'def',    db: 'mydb',    \n table: 'customers',    orgTable: 'customers',    \n name: 'address',    orgName: 'address',    \n charsetNr: 33,    length: 765,    type: \n 253,    flags: 0,    decimals: 0,    \n default: undefined,    zeroFill: false,    \n protocol41: true  }]\n\nAs you can see from the result of the example above, the fields object is an \narray containing information about each field as an object.\nTo return e.g. the name of the second field, just refer to the second array item's name property:\n\nExample\nReturn the name of the second field:\n\n console.log(fields[1].name);\n\nWhich will produce this result:\n\n\n address\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n con.query(\"SELECT * FROM customers\", function (err, result, fields) {    \n if (err) throw err;    console.log(result);  });\n });" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_select.js" + }, + { + "language": "javascript", + "code": "[  { id: 1, name: 'John', address: 'Highway 71'},  { id: \n 2, name: 'Peter', address: 'Lowstreet 4'},  { id: 3, name: 'Amy', \n address: 'Apple st 652'},  { id: 4, name: 'Hannah', address: \n 'Mountain 21'},  { id: 5, name: 'Michael', address: 'Valley 345'},  \n { id: 6, name: 'Sandy', address: 'Ocean blvd 2'},  { id: 7, \n name: 'Betty', address: 'Green Grass 1'},  { id: 8, name: 'Richard', \n address: 'Sky st 331'},  { id: 9, name: 'Susan', address: 'One way \n 98'},  { id: 10, name: 'Vicky', address: 'Yellow Garden 2'},  \n { id: 11, name: 'Ben', address: 'Park Lane 38'},  { id: 12, name: 'William', \n address: 'Central st 954'},  { id: 13, name: 'Chuck', address: \n 'Main Road 989'},  { id: 14, name: 'Viola', address: 'Sideway \n 1633'}]" + }, + { + "language": "javascript", + "code": "var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n con.query(\"SELECT name, address FROM customers\", function (err, result, fields) {    \n if (err) throw err;    console.log(result);  });\n });" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_select2.js" + }, + { + "language": "javascript", + "code": "[  { name: 'John', address: 'Highway 71'},  { name: 'Peter', address: 'Lowstreet 4'},  { name: 'Amy', \n address: 'Apple st 652'},  { name: 'Hannah', address: \n 'Mountain 21'},  { name: 'Michael', address: 'Valley 345'},  \n { name: 'Sandy', address: 'Ocean blvd 2'},  { \n name: 'Betty', address: 'Green Grass 1'},  { name: 'Richard', \n address: 'Sky st 331'},  { name: 'Susan', address: 'One way \n 98'},  { name: 'Vicky', address: 'Yellow Garden 2'},  \n { name: 'Ben', address: 'Park Lane 38'},  { name: 'William', \n address: 'Central st 954'},  { name: 'Chuck', address: \n 'Main Road 989'},  { name: 'Viola', address: 'Sideway \n 1633'}]" + }, + { + "language": "javascript", + "code": "console.log(result[2].address);" + }, + { + "language": "javascript", + "code": "Apple st 652" + }, + { + "language": "javascript", + "code": "var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n con.query(\"SELECT name, address FROM customers\", function (err, \n result, fields) {    \n if (err) throw err;    console.log(fields);  });\n });" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_select_fields.js" + }, + { + "language": "javascript", + "code": "[  {    catalog: 'def',    db: \n 'mydb',    table: 'customers',    \n orgTable: 'customers',    name: 'name',    \n orgName: 'name',    charsetNr: 33,    \n length: 765,    type: 253,    flags: 0,    \n decimals: 0,    default: undefined,    \n zeroFill: false,    protocol41: true  },  {    catalog: 'def',    db: 'mydb',    \n table: 'customers',    orgTable: 'customers',    \n name: 'address',    orgName: 'address',    \n charsetNr: 33,    length: 765,    type: \n 253,    flags: 0,    decimals: 0,    \n default: undefined,    zeroFill: false,    \n protocol41: true  }]" + }, + { + "language": "javascript", + "code": "console.log(fields[1].name);" + }, + { + "language": "javascript", + "code": "address" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_where.asp", + "content": "Node.js MySQL Where\n\n❮ Previous\nNext ❯\n\n\nSelect With a Filter\nWhen selecting records from a table, you can filter the selection by using \nthe \"WHERE\" statement:\n\nExample\nSelect record(s) with the address \"Park Lane 38\":\n\n var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n con.query(\"SELECT * FROM customers WHERE address = 'Park Lane 38'\", function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });\nRun example »\n\nSave the code above in a file called \"demo_db_where.js\" and run the file:\n\nRun \"demo_db_where.js\"\n\nC:\\Users\\Your Name>node demo_db_where.js\n\n\nWhich will give you this result:\n\n\n [  { id: 11, name: 'Ben', address: 'Park Lane 38'}]\n\n\n\n\n\n\n\nWildcard Characters\nYou can also select the records that starts, includes, or ends with a given letter \nor phrase.\nUse the '%' wildcard to represent zero, one or multiple characters:\n\nExample\nSelect records where the address starts with the letter 'S':\n\n var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n con.query(\"SELECT * FROM customers WHERE address LIKE 'S%'\", function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });\nRun example »\n\nSave the code above in a file called \"demo_db_where_s.js\" and run the file:\n\nRun \"demo_db_where_s.js\"\n\nC:\\Users\\Your Name>node demo_db_where_s.js\n\n\nWhich will give you this result:\n\n\n [  { id: 8, name: 'Richard', \n address: 'Sky st 331'},  { id: 14, name: 'Viola', address: 'Sideway \n 1633'}]\n\n\nEscaping Query Values\nWhen query values are variables provided by the user, you should escape the values.\nThis is to prevent SQL injections, which is a common web hacking technique to \ndestroy or misuse your database.\nThe MySQL module has methods to escape query values:\n\nExample\nEscape query values by using the mysql.escape() \nmethod:\n\n var adr = 'Mountain 21';var sql = 'SELECT * FROM customers WHERE address = \n ' + mysql.escape(adr);con.query(sql, function (err, result) {  \n if (err) throw err;  console.log(result);});\nRun example »\n\nYou can also use a ? as a placeholder for \nthe values you want to escape.\nIn this case, the variable is sent as the second parameter in the query() \nmethod:\n\nExample\nEscape query values by using the placeholder ? \nmethod:\n\n var adr = 'Mountain 21';var sql = 'SELECT * FROM customers WHERE address = \n ?';con.query(sql, [adr], function (err, result) {  \n if (err) throw err;  console.log(result);});\nRun example »\n\nIf you have multiple placeholders, the array contains multiple values, in \nthat order:\n\nExample\nMultiple placeholders:\n\n var name = 'Amy';var adr = 'Mountain 21';var sql = 'SELECT * FROM \n customers WHERE name = ? OR address = ?';con.query(sql, [name, adr], function (err, result) {  \n if (err) throw err;  console.log(result);});\nRun example »\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n con.query(\"SELECT * FROM customers WHERE address = 'Park Lane 38'\", function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_where.js" + }, + { + "language": "javascript", + "code": "[  { id: 11, name: 'Ben', address: 'Park Lane 38'}]" + }, + { + "language": "javascript", + "code": "var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n con.query(\"SELECT * FROM customers WHERE address LIKE 'S%'\", function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_where_s.js" + }, + { + "language": "javascript", + "code": "[  { id: 8, name: 'Richard', \n address: 'Sky st 331'},  { id: 14, name: 'Viola', address: 'Sideway \n 1633'}]" + }, + { + "language": "javascript", + "code": "var adr = 'Mountain 21';var sql = 'SELECT * FROM customers WHERE address = \n ' + mysql.escape(adr);con.query(sql, function (err, result) {  \n if (err) throw err;  console.log(result);});" + }, + { + "language": "javascript", + "code": "var adr = 'Mountain 21';var sql = 'SELECT * FROM customers WHERE address = \n ?';con.query(sql, [adr], function (err, result) {  \n if (err) throw err;  console.log(result);});" + }, + { + "language": "javascript", + "code": "var name = 'Amy';var adr = 'Mountain 21';var sql = 'SELECT * FROM \n customers WHERE name = ? OR address = ?';con.query(sql, [name, adr], function (err, result) {  \n if (err) throw err;  console.log(result);});" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_orderby.asp", + "content": "Node.js MySQL Order By\n\n❮ Previous\nNext ❯\n\n\nSort the Result\nUse the ORDER BY statement to sort the result in ascending or descending \norder.\nThe ORDER BY keyword sorts the result ascending by default. To sort the \nresult in descending order, use the DESC keyword.\n\nExample\nSort the result alphabetically by name:\n\n var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n con.query(\"SELECT * FROM customers ORDER BY name\", function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });\nRun example »\n\nSave the code above in a file called \"demo_db_orderby.js\" and run the file:\n\nRun \"demo_db_orderby.js\"\n\nC:\\Users\\Your Name>node demo_db_orderby.js\n\n\nWhich will give you this result:\n\n\n [  { id: 3, name: 'Amy', \n address: 'Apple st 652'},  \n { id: 11, name: 'Ben', address: 'Park Lane 38'},  { id: 7, \n name: 'Betty', address: 'Green Grass 1'},  { id: 13, name: 'Chuck', address: \n 'Main Road 989'},  { id: 4, name: 'Hannah', address: \n 'Mountain 21'},  { id: 1, name: 'John', address: 'Higheay 71'},  { id: 5, name: 'Michael', address: 'Valley 345'},  { id: \n 2, name: 'Peter', address: 'Lowstreet 4'},  { id: 8, name: 'Richard', \n address: 'Sky st 331'},  \n { id: 6, name: 'Sandy', address: 'Ocean blvd 2'},  { id: 9, name: 'Susan', address: 'One way \n 98'},  { id: 10, name: 'Vicky', address: 'Yellow Garden 2'},  { id: 14, name: 'Viola', address: 'Sideway \n 1633'},  { id: 12, name: 'William', \n address: 'Central st 954'}]\n\n\n\n\n\n\n\nORDER BY DESC\nUse the DESC keyword to sort the result in a descending order.\n\nExample\nSort the result reverse alphabetically by name:\n\n var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n con.query(\"SELECT * FROM customers ORDER BY name DESC\", function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });\nRun example »\n\nSave the code above in a file called \"demo_db_orderby_desc.js\" and run the file:\n\nRun \"demo_db_orderby_desc.js\"\n\nC:\\Users\\Your Name>node demo_db_orderby_desc.js\n\n\nWhich will give you this result:\n\n\n [  { id: 12, name: 'William', \n address: 'Central st 954'},  { id: 14, name: 'Viola', address: 'Sideway \n 1633'},  { id: 10, name: 'Vicky', address: 'Yellow Garden 2'},  { id: 9, name: 'Susan', address: 'One way \n 98'},  \n { id: 6, name: 'Sandy', address: 'Ocean blvd 2'},  { id: 8, name: 'Richard', \n address: 'Sky st 331'},  { id: \n 2, name: 'Peter', address: 'Lowstreet 4'},  { id: 5, name: 'Michael', address: 'Valley 345'},  { id: 1, name: 'John', address: 'Higheay 71'},  { id: 4, name: 'Hannah', address: \n 'Mountain 21'},  { id: 13, name: 'Chuck', address: \n 'Main Road 989'},  { id: 7, \n name: 'Betty', address: 'Green Grass 1'},  \n { id: 11, name: 'Ben', address: 'Park Lane 38'},  { id: 3, name: 'Amy', \n address: 'Apple st 652'}]\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n con.query(\"SELECT * FROM customers ORDER BY name\", function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_orderby.js" + }, + { + "language": "javascript", + "code": "[  { id: 3, name: 'Amy', \n address: 'Apple st 652'},  \n { id: 11, name: 'Ben', address: 'Park Lane 38'},  { id: 7, \n name: 'Betty', address: 'Green Grass 1'},  { id: 13, name: 'Chuck', address: \n 'Main Road 989'},  { id: 4, name: 'Hannah', address: \n 'Mountain 21'},  { id: 1, name: 'John', address: 'Higheay 71'},  { id: 5, name: 'Michael', address: 'Valley 345'},  { id: \n 2, name: 'Peter', address: 'Lowstreet 4'},  { id: 8, name: 'Richard', \n address: 'Sky st 331'},  \n { id: 6, name: 'Sandy', address: 'Ocean blvd 2'},  { id: 9, name: 'Susan', address: 'One way \n 98'},  { id: 10, name: 'Vicky', address: 'Yellow Garden 2'},  { id: 14, name: 'Viola', address: 'Sideway \n 1633'},  { id: 12, name: 'William', \n address: 'Central st 954'}]" + }, + { + "language": "javascript", + "code": "var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n con.query(\"SELECT * FROM customers ORDER BY name DESC\", function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_orderby_desc.js" + }, + { + "language": "javascript", + "code": "[  { id: 12, name: 'William', \n address: 'Central st 954'},  { id: 14, name: 'Viola', address: 'Sideway \n 1633'},  { id: 10, name: 'Vicky', address: 'Yellow Garden 2'},  { id: 9, name: 'Susan', address: 'One way \n 98'},  \n { id: 6, name: 'Sandy', address: 'Ocean blvd 2'},  { id: 8, name: 'Richard', \n address: 'Sky st 331'},  { id: \n 2, name: 'Peter', address: 'Lowstreet 4'},  { id: 5, name: 'Michael', address: 'Valley 345'},  { id: 1, name: 'John', address: 'Higheay 71'},  { id: 4, name: 'Hannah', address: \n 'Mountain 21'},  { id: 13, name: 'Chuck', address: \n 'Main Road 989'},  { id: 7, \n name: 'Betty', address: 'Green Grass 1'},  \n { id: 11, name: 'Ben', address: 'Park Lane 38'},  { id: 3, name: 'Amy', \n address: 'Apple st 652'}]" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_delete.asp", + "content": "Node.js MySQL Delete\n\n❮ Previous\nNext ❯\n\n\nDelete Record\nYou can delete records from an existing table by using \nthe \"DELETE FROM\" statement:\n\nExample\nDelete any record with the address \"Mountain 21\":\n\n var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n var sql = \"DELETE FROM customers WHERE address = 'Mountain 21'\";  \n con.query(sql, function (err, result) {    \n if (err) throw err;    console.log(\"Number of records \n deleted: \" + result.affectedRows);  });\n });\nRun example »\n\n\nNotice the WHERE clause in the DELETE syntax: The WHERE clause \nspecifies which record or records that should be deleted. If you omit the WHERE \nclause, all records will be deleted!\n\nSave the code above in a file called \"demo_db_delete.js\" and run the file:\n\nRun \"demo_db_delete.js\"\n\nC:\\Users\\Your Name>node demo_db_delete.js\n\n\nWhich will give you this result:\n\n\n Number of records deleted: 1\n\n\n\n\n\n\n\nThe Result Object\nWhen executing a query, a result object is returned.\nThe result object contains information about how the query \naffected the table.\nThe result object returned from the example above looks like this:\n\n\n {  fieldCount: 0,  affectedRows: 1,  insertId: 0,  \n serverStatus: 34,  warningCount: 0,  message: '',  protocol41: true,  \n changedRows: 0}\n\nThe values of the properties can be displayed like this:\n\nExample\nReturn the number of affected rows:\n\nconsole.log(result.affectedRows)\n\n\nWhich will produce this result:\n\n\n 1\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n var sql = \"DELETE FROM customers WHERE address = 'Mountain 21'\";  \n con.query(sql, function (err, result) {    \n if (err) throw err;    console.log(\"Number of records \n deleted: \" + result.affectedRows);  });\n });" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_delete.js" + }, + { + "language": "javascript", + "code": "Number of records deleted: 1" + }, + { + "language": "javascript", + "code": "{  fieldCount: 0,  affectedRows: 1,  insertId: 0,  \n serverStatus: 34,  warningCount: 0,  message: '',  protocol41: true,  \n changedRows: 0}" + }, + { + "language": "javascript", + "code": "console.log(result.affectedRows)" + }, + { + "language": "javascript", + "code": "1" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_drop_table.asp", + "content": "Node.js MySQL Drop Table\n\n❮ Previous\nNext ❯\n\n\nDelete a Table\nYou can delete an existing table by using \nthe \"DROP TABLE\" statement:\n\nExample\nDelete the table \"customers\":\n\n var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n var sql = \"DROP TABLE customers\";  \n con.query(sql, function (err, result) {    \n if (err) throw err;    console.log(\"Table deleted\");  });\n });\nRun example »\n\nSave the code above in a file called \"demo_db_drop_table.js\" and run the file:\n\nRun \"demo_db_drop_table.js\"\n\nC:\\Users\\Your Name>node demo_db_drop_table.js\n\n\nWhich will give you this result:\n\n\n Table deleted\n\n\n\n\n\n\n\nDrop Only if Exist\nIf the the table you want to delete is already deleted, or for any other \nreason does not exist, you can use the IF EXISTS keyword to avoid getting an \nerror.\n\nExample\nDelete the table \"customers\" if it exists:\n\n var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n var sql = \"DROP TABLE IF EXISTS customers\";  \n con.query(sql, function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });\nRun example »\n\nSave the code above in a file called \"demo_db_drop_table_if.js\" and run the file:\n\nRun \"demo_db_drop_table_if.js\"\n\nC:\\Users\\Your Name>node demo_db_drop_table_if.js\n\n\nIf the table exist, the result object will look like this:\n\n\n {  fieldCount: 0,  affectedRows: 0,  insertId: 0,  \n serverstatus: 2,  warningCount: 0,  message: '',  \n protocol41: true,  changedRows: 0}\n\nIf the table does not exist, the result object will look like this:\n\n\n {  fieldCount: 0,  affectedRows: 0,  insertId: 0,  \n serverstatus: 2,  warningCount: 1,  message: '',  \n protocol41: true,  changedRows: 0}\n\nAs you can see the only differnce is that the warningCount property is set to 1 if the table does not exist.\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n var sql = \"DROP TABLE customers\";  \n con.query(sql, function (err, result) {    \n if (err) throw err;    console.log(\"Table deleted\");  });\n });" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_drop_table.js" + }, + { + "language": "javascript", + "code": "Table deleted" + }, + { + "language": "javascript", + "code": "var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n var sql = \"DROP TABLE IF EXISTS customers\";  \n con.query(sql, function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_drop_table_if.js" + }, + { + "language": "javascript", + "code": "{  fieldCount: 0,  affectedRows: 0,  insertId: 0,  \n serverstatus: 2,  warningCount: 0,  message: '',  \n protocol41: true,  changedRows: 0}" + }, + { + "language": "javascript", + "code": "{  fieldCount: 0,  affectedRows: 0,  insertId: 0,  \n serverstatus: 2,  warningCount: 1,  message: '',  \n protocol41: true,  changedRows: 0}" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_update.asp", + "content": "Node.js MySQL Update\n\n❮ Previous\nNext ❯\n\n\nUpdate Table\nYou can update existing records in a table by using \nthe \"UPDATE\" statement:\n\nExample\nOverwrite the address column from \"Valley 345\" to \"Canyon 123\":\n\n var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n var sql = \"UPDATE customers SET address = 'Canyon 123' WHERE address = \n 'Valley 345'\";  \n con.query(sql, function (err, result) {    \n if (err) throw err;    console.log(result.affectedRows + \" \n record(s) updated\");  });\n });\nRun example »\n\n\nNotice the WHERE clause in the UPDATE syntax: The WHERE clause \nspecifies which record or records that should be updated. If you omit the WHERE \nclause, all records will be updated!\n\nSave the code above in a file called \"demo_db_update.js\" and run the file:\n\nRun \"demo_db_update.js\"\n\nC:\\Users\\Your Name>node demo_db_update.js\n\n\nWhich will give you this result:\n\n\n 1 record(s) updated\n\n\n\n\n\n\n\nThe Result Object\nWhen executing a query, a result object is returned.\nThe result object contains information about how the query \naffected the table.\nThe result object returned from the example above looks like this:\n\n\n {  fieldCount: 0,  affectedRows: 1,  insertId: 0,  \n serverStatus: 34,  warningCount: 0,  message: '(Rows \n matched: 1 Changed: 1 Warnings: 0',  protocol41: true,  \n changedRows: 1}\n\nThe values of the properties can be displayed like this:\n\nExample\nReturn the number of affected rows:\n\nconsole.log(result.affectedRows)\n\n\nWhich will produce this result:\n\n\n 1\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n var sql = \"UPDATE customers SET address = 'Canyon 123' WHERE address = \n 'Valley 345'\";  \n con.query(sql, function (err, result) {    \n if (err) throw err;    console.log(result.affectedRows + \" \n record(s) updated\");  });\n });" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_update.js" + }, + { + "language": "javascript", + "code": "1 record(s) updated" + }, + { + "language": "javascript", + "code": "{  fieldCount: 0,  affectedRows: 1,  insertId: 0,  \n serverStatus: 34,  warningCount: 0,  message: '(Rows \n matched: 1 Changed: 1 Warnings: 0',  protocol41: true,  \n changedRows: 1}" + }, + { + "language": "javascript", + "code": "console.log(result.affectedRows)" + }, + { + "language": "javascript", + "code": "1" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_limit.asp", + "content": "Node.js MySQL Limit\n\n❮ Previous\nNext ❯\n\n\nLimit the Result\nYou can limit the number of records returned from the query, by using the \"LIMIT\" statement:\n\nExample\nSelect the 5 first records in the \"customers\" table:\n\n var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n var sql = \"SELECT * FROM customers LIMIT 5\";  \n con.query(sql, function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });\nRun example »\n\nSave the code above in a file called \"demo_db_limit.js\" and run the file:\n\nRun \"demo_db_limit.js\"\n\nC:\\Users\\Your Name>node demo_db_limit.js\n\n\nWhich will give you this result:\n\n\n [  { id: 1, name: 'John', address: 'Highway 71'},  { id: \n 2, name: 'Peter', address: 'Lowstreet 4'},  { id: 3, name: 'Amy', \n address: 'Apple st 652'},  { id: 4, name: 'Hannah', address: \n 'Mountain 21'},  { id: 5, name: 'Michael', address: 'Valley 345'}]\n\n\n\n\n\n\n\nStart From Another Position\nIf you want to return five records, starting from the third record, you \ncan use the \"OFFSET\" keyword:\n\nExample\nStart from position 3, and return the next 5 records:\n\n var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n var sql = \"SELECT * FROM customers LIMIT 5 OFFSET 2\";  \n con.query(sql, function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });\nRun example »\n\n\nNote: \"OFFSET 2\", means starting from the third position, \nnot the second!\n\nSave the code above in a file called \"demo_db_offset.js\" and run the file:\n\nRun \"demo_db_offset.js\"\n\nC:\\Users\\Your Name>node demo_db_offset.js\n\n\nWhich will give you this result:\n\n\n [  { id: 3, name: 'Amy', \n address: 'Apple st 652'},  { id: 4, name: 'Hannah', address: \n 'Mountain 21'},  { id: 5, name: 'Michael', address: 'Valley 345'},  \n { id: 6, name: 'Sandy', address: 'Ocean blvd 2'},  { id: 7, name: 'Betty', \n address: 'Green Grass 1'}]\n\n\nShorter Syntax\nYou can also write your SQL statement like this \"LIMIT 2, 5\" which \nreturns the same as the offset example above:\n\nExample\nStart from position 3, and return the next 5 records:\n\n var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n var sql = \"SELECT * FROM customers LIMIT 2, 5\";  \n con.query(sql, function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });\nRun example »\n\n\nNote: The numbers are reversed: \"LIMIT 2, 5\" is the \n same as \"LIMIT 5 OFFSET 2\"\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n var sql = \"SELECT * FROM customers LIMIT 5\";  \n con.query(sql, function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_limit.js" + }, + { + "language": "javascript", + "code": "[  { id: 1, name: 'John', address: 'Highway 71'},  { id: \n 2, name: 'Peter', address: 'Lowstreet 4'},  { id: 3, name: 'Amy', \n address: 'Apple st 652'},  { id: 4, name: 'Hannah', address: \n 'Mountain 21'},  { id: 5, name: 'Michael', address: 'Valley 345'}]" + }, + { + "language": "javascript", + "code": "var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n var sql = \"SELECT * FROM customers LIMIT 5 OFFSET 2\";  \n con.query(sql, function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_offset.js" + }, + { + "language": "javascript", + "code": "[  { id: 3, name: 'Amy', \n address: 'Apple st 652'},  { id: 4, name: 'Hannah', address: \n 'Mountain 21'},  { id: 5, name: 'Michael', address: 'Valley 345'},  \n { id: 6, name: 'Sandy', address: 'Ocean blvd 2'},  { id: 7, name: 'Betty', \n address: 'Green Grass 1'}]" + }, + { + "language": "javascript", + "code": "var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  \n var sql = \"SELECT * FROM customers LIMIT 2, 5\";  \n con.query(sql, function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mysql_join.asp", + "content": "Node.js MySQL Join\n\n❮ Previous\nNext ❯\n\n\nJoin Two or More Tables\nYou can combine rows from two or more tables, based on a related column \nbetween them, by using a JOIN statement.\nConsider you have a \"users\" table and a \"products\" table:\n\nusers\n[  { id: 1, name: 'John', \n favorite_product: 154},  { id: \n 2, name: 'Peter', favorite_product: 154},  { id: 3, name: 'Amy', \n favorite_product: 155},  { id: 4, name: 'Hannah', favorite_product:},  { id: 5, name: 'Michael', \n favorite_product:}]\n\n\nproducts\n[  { id: 154, name: \n 'Chocolate Heaven' },  { id: 155, name: 'Tasty Lemons' },  { \n id: 156, name: 'Vanilla Dreams' }]\n\nThese two tables can be combined by using users' favorite_product field and products' \nid field.\n\nExample\nSelect records with a match in both tables:\n\n var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  var \n sql = \"SELECT users.name AS user, products.name AS favorite FROM users \n JOIN products ON \n users.favorite_product = products.id\";  \n con.query(sql, function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });\nRun example »\n\n\nNote: You can use INNER JOIN instead of JOIN. They will \n both give you the same result.\n\nSave the code above in a file called \"demo_db_join.js\" and run the file:\n\nRun \"demo_db_join.js\"\n\nC:\\Users\\Your Name>node demo_db_join.js\n\n\nWhich will give you this result:\n\n[  { user: 'John', favorite: \n 'Chocolate Heaven' },  { user: 'Peter', favorite: 'Chocolate Heaven' },  { \n user: 'Amy', favorite: 'Tasty Lemons' }]\n\nAs you can see from the result above, only the records with a match in both \ntables are returned.\n\n\n\n\n\n\nLeft Join\nIf you want to return all users, no matter if they have a favorite product or \nnot, use the LEFT JOIN statement:\n\nExample\nSelect all users and their favorite product:\n\n SELECT users.name AS user,products.name AS favoriteFROM usersLEFT\n JOIN products ON users.favorite_product = products.id\nRun example »\n\nWhich will give you this result:\n\n[  { user: 'John', favorite: \n 'Chocolate Heaven' },  { user: 'Peter', favorite: 'Chocolate Heaven' },  { \n user: 'Amy', favorite: 'Tasty Lemons' },  { \n user: 'Hannah', favorite: null },  { user: 'Michael', favorite: null }]\n\n\nRight Join\nIf you want to return all products, and the users who have them as their \nfavorite, even if no user have them as their favorite, use the RIGHT JOIN \nstatement:\n\nExample\nSelect all products and the user who have them as their favorite:\n\n SELECT users.name AS user,products.name AS favoriteFROM usersRIGHT\n JOIN products ON users.favorite_product = products.id\nRun example »\n\nWhich will give you this result:\n\n[  { user: 'John', favorite: \n 'Chocolate Heaven' },  { user: 'Peter', favorite: 'Chocolate Heaven' },  { \n user: 'Amy', favorite: 'Tasty Lemons' },  { \n user: null, favorite: 'Vanilla Dreams' }]\n\n\nNote: Hannah and Michael, who have no favorite product, are not included in the result.\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "[  { id: 1, name: 'John', \n favorite_product: 154},  { id: \n 2, name: 'Peter', favorite_product: 154},  { id: 3, name: 'Amy', \n favorite_product: 155},  { id: 4, name: 'Hannah', favorite_product:},  { id: 5, name: 'Michael', \n favorite_product:}]" + }, + { + "language": "javascript", + "code": "[  { id: 154, name: \n 'Chocolate Heaven' },  { id: 155, name: 'Tasty Lemons' },  { \n id: 156, name: 'Vanilla Dreams' }]" + }, + { + "language": "javascript", + "code": "var mysql = require('mysql');\n var con = mysql.createConnection({  \n host: \"localhost\",  user: \"yourusername\",  \n password: \"yourpassword\",  database: \"mydb\"});\ncon.connect(function(err) {  if (err) throw err;  var \n sql = \"SELECT users.name AS user, products.name AS favorite FROM users \n JOIN products ON \n users.favorite_product = products.id\";  \n con.query(sql, function (err, result) {    \n if (err) throw err;    console.log(result);  });\n });" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_db_join.js" + }, + { + "language": "javascript", + "code": "[  { user: 'John', favorite: \n 'Chocolate Heaven' },  { user: 'Peter', favorite: 'Chocolate Heaven' },  { \n user: 'Amy', favorite: 'Tasty Lemons' }]" + }, + { + "language": "javascript", + "code": "SELECT users.name AS user,products.name AS favoriteFROM usersLEFT\n JOIN products ON users.favorite_product = products.id" + }, + { + "language": "javascript", + "code": "[  { user: 'John', favorite: \n 'Chocolate Heaven' },  { user: 'Peter', favorite: 'Chocolate Heaven' },  { \n user: 'Amy', favorite: 'Tasty Lemons' },  { \n user: 'Hannah', favorite: null },  { user: 'Michael', favorite: null }]" + }, + { + "language": "javascript", + "code": "SELECT users.name AS user,products.name AS favoriteFROM usersRIGHT\n JOIN products ON users.favorite_product = products.id" + }, + { + "language": "javascript", + "code": "[  { user: 'John', favorite: \n 'Chocolate Heaven' },  { user: 'Peter', favorite: 'Chocolate Heaven' },  { \n user: 'Amy', favorite: 'Tasty Lemons' },  { \n user: null, favorite: 'Vanilla Dreams' }]" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb.asp", + "content": "Node.js MongoDB\n\n❮ Previous\nNext ❯\n\n\nNode.js can be used in database applications.\nOne of the most popular NoSQL database is MongoDB.\n\nMongoDB\nTo be able to experiment with the code examples, you will need access to a MongoDB database.\nYou can download a free MongoDB database at\nhttps://www.mongodb.com.\nOr get started right away with a MongoDB cloud service at \nhttps://www.mongodb.com/cloud/atlas.\n\nInstall MongoDB Driver\nLet us try to access a MongoDB database with Node.js.\nTo download and install the official MongoDB driver, open the Command Terminal and execute the following:\n\nDownload and install mongodb package:\n\nC:\\Users\\Your Name>npm install mongodb\n\n\nNow you have downloaded and installed a mongodb database driver.\nNode.js can use this module to manipulate MongoDB databases:\n\n\n var mongo = require('mongodb');\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "C:\\Users\\Your Name>npm install mongodb" + }, + { + "language": "javascript", + "code": "var mongo = require('mongodb');" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_create_db.asp", + "content": "Node.js MongoDB Create Database\n\n❮ Previous\nNext ❯\n\n\nCreating a Database\nTo create a database in MongoDB, start by creating a MongoClient object, then specify a connection URL with the \ncorrect ip address and the name of the database you want to create.\nMongoDB will create the database if it does not exist, and make a connection \nto it.\n\nExample\nCreate a database called \"mydb\":\n\n var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/mydb\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  console.log(\"Database \n created!\");  db.close();});\nRun example »\n\nSave the code above in a file called \"demo_create_mongo_db.js\" and run the file:\n\nRun \"demo_create_mongo_db.js\"\n\nC:\\Users\\Your Name>node demo_create_mongo_db.js\n\n\nWhich will give you this result:\n\n\n Database created!\n\n\nImportant: In MongoDB, a database is not created until it \n gets content!\n\nMongoDB waits until you have created a collection (table), with at least one document (record) before it actually creates the database (and collection).\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/mydb\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  console.log(\"Database \n created!\");  db.close();});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_create_mongo_db.js" + }, + { + "language": "javascript", + "code": "Database created!" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_createcollection.asp", + "content": "Node.js MongoDB Create Collection\n\n❮ Previous\nNext ❯\n\n\n\nA collection in MongoDB is the same as a table in MySQL\n\nCreating a Collection\nTo create a collection in MongoDB, use the createCollection() method:\n\nExample\nCreate a collection called \"customers\":\n\n var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");\n   dbo.createCollection(\"customers\", \n function(err, res) {    if (err) throw err;    console.log(\"Collection created!\");    db.close();  });});\nRun example »\n\nSave the code above in a file called \"demo_mongodb_createcollection.js\" and run the file:\n\nRun \"demo_mongodb_createcollection.js\"\n\nC:\\Users\\Your Name>node demo_mongodb_createcollection.js\n\n\nWhich will give you this result:\n\n\n Collection created!\n\n\nImportant: In MongoDB, a collection is not created until it \n gets content!\n\nMongoDB waits until you have inserted a document before it actually creates the collection.\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");\n   dbo.createCollection(\"customers\", \n function(err, res) {    if (err) throw err;    console.log(\"Collection created!\");    db.close();  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_mongodb_createcollection.js" + }, + { + "language": "javascript", + "code": "Collection created!" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_insert.asp", + "content": "Node.js MongoDB Insert\n\n❮ Previous\nNext ❯\n\n\nInsert Into Collection\nTo insert a record, or document as it is called in MongoDB, into a collection, we use the \ninsertOne() method.\n\nA document in MongoDB is the same as a record in MySQL\n\nThe first parameter of the insertOne() method is an object containing the \nname(s) and value(s) of each field in the document you want to insert.\nIt also takes a callback function where you can work with any errors, or the \nresult of the insertion:\n\nExample\nInsert a document in the \"customers\" collection:\n\n var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n var myobj = { name: \"Company \n Inc\", address: \"Highway 37\" };  dbo.collection(\"customers\").insertOne(myobj, function(err, res) {\n     if (err) throw err;    console.log(\"1 \n document \n inserted\");    db.close();  });});\nRun example »\n\nSave the code above in a file called \"demo_mongodb_insert.js\" and run the file:\n\nRun \"demo_mongodb_insert.js\"\n\nC:\\Users\\Your Name>node demo_mongodb_insert.js\n\n\nWhich will give you this result:\n\n\n 1 document inserted\n\n\nNote: If you try to insert documents in a collection that do not \nexist, MongoDB will create the collection automatically.\n\n\n\n\n\n\n\nInsert Multiple Documents\nTo insert multiple documents into a collection in MongoDB, we use the \ninsertMany() method.\nThe first parameter of the insertMany() method \nis an array of objects, containing the data you want to \ninsert.\nIt also takes a callback function where you can work with any errors, or the \nresult of the insertion:\n\nExample\nInsert multiple documents in the \"customers\" collection:\n\n var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n var myobj = [    { name: 'John', address: 'Highway 71'},    \n { name: 'Peter', address: 'Lowstreet 4'},    { name: 'Amy', \n address: 'Apple st 652'},    { name: 'Hannah', address: \n 'Mountain 21'},    { name: 'Michael', address: 'Valley \n 345'},    { name: 'Sandy', address: 'Ocean blvd 2'},    \n { name: 'Betty', address: 'Green Grass 1'},    { name: \n 'Richard', address: 'Sky st 331'},    { name: 'Susan', \n address: 'One way 98'},    { name: 'Vicky', address: \n 'Yellow Garden 2'},    { name: 'Ben', address: 'Park Lane \n 38'},    { name: 'William', address: 'Central st 954'},    \n { name: 'Chuck', address: 'Main Road 989'},    { name: \n 'Viola', address: 'Sideway 1633'}  ];  dbo.collection(\"customers\").insertMany(myobj, \n function(err, res) {    if (err) throw err;    \n console.log(\"Number of documents inserted: \" + res.insertedCount);    \n db.close();  });});\nRun example »\n\nSave the code above in a file called \"demo_mongodb_insert_multiple.js\" and run the file:\n\nRun \"demo_mongodb_insert_multiple.js\"\n\nC:\\Users\\Your Name>node demo_mongodb_insert_multiple.js\n\n\nWhich will give you this result:\n\n\n Number of documents inserted: 14\n\n\nThe Result Object\nWhen executing the insertMany() method, a result object is returned.\nThe result object contains information about how the insertion affected the \ndatabase.\nThe object returned from the example above looked like this:\n\n\n {  result: { ok: 1, n: 14 },  ops: [    { \n name: 'John', address: 'Highway 71', _id: 58fdbf5c0ef8a50b4cdd9a84 },    \n { name: 'Peter', address: 'Lowstreet 4', _id: 58fdbf5c0ef8a50b4cdd9a85 },    \n { name: 'Amy', address: 'Apple st 652', _id: 58fdbf5c0ef8a50b4cdd9a86 },    \n { name: 'Hannah', address: 'Mountain 21', _id: 58fdbf5c0ef8a50b4cdd9a87 },    \n { name: 'Michael', address: 'Valley 345', _id: 58fdbf5c0ef8a50b4cdd9a88 },    \n { name: 'Sandy', address: 'Ocean blvd 2', _id: 58fdbf5c0ef8a50b4cdd9a89 },    \n { name: 'Betty', address: 'Green Grass 1', _id: 58fdbf5c0ef8a50b4cdd9a8a },    \n { name: 'Richard', address: 'Sky st 331', _id: 58fdbf5c0ef8a50b4cdd9a8b },    \n { name: 'Susan', address: 'One way 98', _id: 58fdbf5c0ef8a50b4cdd9a8c },    \n { name: 'Vicky', address: 'Yellow Garden 2', _id: 58fdbf5c0ef8a50b4cdd9a8d },    \n { name: 'Ben', address: 'Park Lane 38', _id: 58fdbf5c0ef8a50b4cdd9a8e },    \n { name: 'William', address: 'Central st 954', _id: 58fdbf5c0ef8a50b4cdd9a8f },    \n { name: 'Chuck', address: 'Main Road 989', _id: 58fdbf5c0ef8a50b4cdd9a90 },    \n { name: 'Viola', address: 'Sideway 1633', _id: 58fdbf5c0ef8a50b4cdd9a91 } ],  \n insertedCount: 14,  insertedIds: [    \n 58fdbf5c0ef8a50b4cdd9a84,    58fdbf5c0ef8a50b4cdd9a85,    \n 58fdbf5c0ef8a50b4cdd9a86,    58fdbf5c0ef8a50b4cdd9a87,    \n 58fdbf5c0ef8a50b4cdd9a88,    58fdbf5c0ef8a50b4cdd9a89,    \n 58fdbf5c0ef8a50b4cdd9a8a,    58fdbf5c0ef8a50b4cdd9a8b,    \n 58fdbf5c0ef8a50b4cdd9a8c,    58fdbf5c0ef8a50b4cdd9a8d,    \n 58fdbf5c0ef8a50b4cdd9a8e,    58fdbf5c0ef8a50b4cdd9a8f     \n 58fdbf5c0ef8a50b4cdd9a90,    58fdbf5c0ef8a50b4cdd9a91 ]\n }\n\nThe values of the properties can be displayed like this:\n\nExample\nReturn the number of inserted documents:\n\nconsole.log(res.insertedCount)\n\n\nWhich will produce this result:\n\n\n14\n\n\nThe _id Field\nIf you do not specify an _id field, then MongoDB \nwill add one for you and assign a unique id for each document.\nIn the example above no _id field was \nspecified, and as you can see from the result object, MongoDB assigned a unique \n_id for each document.\nIf you do specify the _id field, the value must \nbe unique for each document:\n\nExample\nInsert three records in a \"products\" table, with specified \n_id fields:\n\n var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n var myobj = [    { _id: 154, name: \n 'Chocolate Heaven'},    { _id: 155, name: \n 'Tasty Lemon'},    { _id: 156, name: \n 'Vanilla Dream'}  ];  dbo.collection(\"products\").insertMany(myobj, \n function(err, res) {    if (err) throw err;    \n console.log(res);    db.close();  });});\nRun example »\n\nSave the code above in a file called \"demo_mongodb_insert_id.js\" and run the file:\n\nRun \"demo_mongodb_insert_id.js\"\n\nC:\\Users\\Your Name>node demo_mongodb_insert_id.js\n\n\nWhich will give you this result:\n\n\n {  result: { ok: 1, n: 3 },  ops: [    { \n _id: 154, name: 'Chocolate Heaven },    { \n _id: 155, name: 'Tasty Lemon },    { \n _id: 156, name: 'Vanilla Dream } ],  \n insertedCount: 3,  insertedIds: [    \n 154,    155,    \n 156 ]\n }\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n var myobj = { name: \"Company \n Inc\", address: \"Highway 37\" };  dbo.collection(\"customers\").insertOne(myobj, function(err, res) {\n     if (err) throw err;    console.log(\"1 \n document \n inserted\");    db.close();  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_mongodb_insert.js" + }, + { + "language": "javascript", + "code": "1 document inserted" + }, + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n var myobj = [    { name: 'John', address: 'Highway 71'},    \n { name: 'Peter', address: 'Lowstreet 4'},    { name: 'Amy', \n address: 'Apple st 652'},    { name: 'Hannah', address: \n 'Mountain 21'},    { name: 'Michael', address: 'Valley \n 345'},    { name: 'Sandy', address: 'Ocean blvd 2'},    \n { name: 'Betty', address: 'Green Grass 1'},    { name: \n 'Richard', address: 'Sky st 331'},    { name: 'Susan', \n address: 'One way 98'},    { name: 'Vicky', address: \n 'Yellow Garden 2'},    { name: 'Ben', address: 'Park Lane \n 38'},    { name: 'William', address: 'Central st 954'},    \n { name: 'Chuck', address: 'Main Road 989'},    { name: \n 'Viola', address: 'Sideway 1633'}  ];  dbo.collection(\"customers\").insertMany(myobj, \n function(err, res) {    if (err) throw err;    \n console.log(\"Number of documents inserted: \" + res.insertedCount);    \n db.close();  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_mongodb_insert_multiple.js" + }, + { + "language": "javascript", + "code": "Number of documents inserted: 14" + }, + { + "language": "javascript", + "code": "{  result: { ok: 1, n: 14 },  ops: [    { \n name: 'John', address: 'Highway 71', _id: 58fdbf5c0ef8a50b4cdd9a84 },    \n { name: 'Peter', address: 'Lowstreet 4', _id: 58fdbf5c0ef8a50b4cdd9a85 },    \n { name: 'Amy', address: 'Apple st 652', _id: 58fdbf5c0ef8a50b4cdd9a86 },    \n { name: 'Hannah', address: 'Mountain 21', _id: 58fdbf5c0ef8a50b4cdd9a87 },    \n { name: 'Michael', address: 'Valley 345', _id: 58fdbf5c0ef8a50b4cdd9a88 },    \n { name: 'Sandy', address: 'Ocean blvd 2', _id: 58fdbf5c0ef8a50b4cdd9a89 },    \n { name: 'Betty', address: 'Green Grass 1', _id: 58fdbf5c0ef8a50b4cdd9a8a },    \n { name: 'Richard', address: 'Sky st 331', _id: 58fdbf5c0ef8a50b4cdd9a8b },    \n { name: 'Susan', address: 'One way 98', _id: 58fdbf5c0ef8a50b4cdd9a8c },    \n { name: 'Vicky', address: 'Yellow Garden 2', _id: 58fdbf5c0ef8a50b4cdd9a8d },    \n { name: 'Ben', address: 'Park Lane 38', _id: 58fdbf5c0ef8a50b4cdd9a8e },    \n { name: 'William', address: 'Central st 954', _id: 58fdbf5c0ef8a50b4cdd9a8f },    \n { name: 'Chuck', address: 'Main Road 989', _id: 58fdbf5c0ef8a50b4cdd9a90 },    \n { name: 'Viola', address: 'Sideway 1633', _id: 58fdbf5c0ef8a50b4cdd9a91 } ],  \n insertedCount: 14,  insertedIds: [    \n 58fdbf5c0ef8a50b4cdd9a84,    58fdbf5c0ef8a50b4cdd9a85,    \n 58fdbf5c0ef8a50b4cdd9a86,    58fdbf5c0ef8a50b4cdd9a87,    \n 58fdbf5c0ef8a50b4cdd9a88,    58fdbf5c0ef8a50b4cdd9a89,    \n 58fdbf5c0ef8a50b4cdd9a8a,    58fdbf5c0ef8a50b4cdd9a8b,    \n 58fdbf5c0ef8a50b4cdd9a8c,    58fdbf5c0ef8a50b4cdd9a8d,    \n 58fdbf5c0ef8a50b4cdd9a8e,    58fdbf5c0ef8a50b4cdd9a8f     \n 58fdbf5c0ef8a50b4cdd9a90,    58fdbf5c0ef8a50b4cdd9a91 ]\n }" + }, + { + "language": "javascript", + "code": "console.log(res.insertedCount)" + }, + { + "language": "javascript", + "code": "14" + }, + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n var myobj = [    { _id: 154, name: \n 'Chocolate Heaven'},    { _id: 155, name: \n 'Tasty Lemon'},    { _id: 156, name: \n 'Vanilla Dream'}  ];  dbo.collection(\"products\").insertMany(myobj, \n function(err, res) {    if (err) throw err;    \n console.log(res);    db.close();  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_mongodb_insert_id.js" + }, + { + "language": "javascript", + "code": "{  result: { ok: 1, n: 3 },  ops: [    { \n _id: 154, name: 'Chocolate Heaven },    { \n _id: 155, name: 'Tasty Lemon },    { \n _id: 156, name: 'Vanilla Dream } ],  \n insertedCount: 3,  insertedIds: [    \n 154,    155,    \n 156 ]\n }" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_find.asp", + "content": "Node.js MongoDB Find\n\n❮ Previous\nNext ❯\n\n\n\nIn MongoDB we use the find and findOne methods to find data in a collection.\nJust like the SELECT statement is used to find data in a \n table in a MySQL database.\n\nFind One\nTo select data from a collection in MongoDB, we can use the\nfindOne() method.\nThe findOne() method returns the first \noccurrence in the selection.\nThe first parameter of the findOne() method \nis a query object. In this example we use an empty query object, which selects \nall documents in a collection (but returns only the first document).\n\nExample\nFind the first document in the customers collection:\n\n var MongoClient = require('mongodb').MongoClient;\n var url = \"mongodb://localhost:27017/\";MongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  dbo.collection(\"customers\").findOne({}, function(err, result) {    if (err) throw err;    console.log(result.name);    db.close();  \n });});\nRun example »\n\nSave the code above in a file called \"demo_mongodb_findone.js\" and run the file:\n\nRun \"demo_mongodb_findone.js\"\n\nC:\\Users\\Your Name>node demo_mongodb_findone.js\n\n\nWhich will give you this result:\n\nCompany Inc.\n\n\n\n\n\n\n\nFind All\nTo select data from a table in MongoDB, we can also use the\nfind() method.\nThe find() method returns all \noccurrences in the selection.\nThe first parameter of the find() method \nis a query object. In this example we use an empty query object, which selects \nall documents in the collection.\n\nNo parameters in the find() method gives you the same result as SELECT * in MySQL.\n\n\nExample\nFind all documents in the customers collection:\n\n var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection(\"customers\").find({}).toArray(function(err, result) {    \n if (err) throw err;    console.log(result);    \n db.close();  });});\nRun example »\n\nSave the code above in a file called \"demo_mongodb_find.js\" and run the file:\n\nRun \"demo_mongodb_find.js\"\n\nC:\\Users\\Your Name>node demo_mongodb_find.js\n\n\nWhich will give you this result:\n\n[  { _id: \n 58fdbf5c0ef8a50b4cdd9a84 , name: 'John', address: 'Highway 71'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a85 , name: 'Peter', address: 'Lowstreet 4'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a86 , name: 'Amy', \n address: 'Apple st 652'},  { _id: 58fdbf5c0ef8a50b4cdd9a87 , name: 'Hannah', address: \n 'Mountain 21'},  { _id: 58fdbf5c0ef8a50b4cdd9a88 , name: 'Michael', address: 'Valley 345'},  \n { _id: 58fdbf5c0ef8a50b4cdd9a89 , name: 'Sandy', address: 'Ocean blvd 2'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a8a , \n name: 'Betty', address: 'Green Grass 1'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a8b , name: 'Richard', \n address: 'Sky st 331'},  { _id: 58fdbf5c0ef8a50b4cdd9a8c , name: 'Susan', address: 'One way \n 98'},  { _id: 58fdbf5c0ef8a50b4cdd9a8d , name: 'Vicky', address: 'Yellow Garden 2'},  \n { _id: 58fdbf5c0ef8a50b4cdd9a8e , name: 'Ben', address: 'Park Lane 38'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a8f , name: 'William', \n address: 'Central st 954'},  { _id: 58fdbf5c0ef8a50b4cdd9a90 , name: 'Chuck', address: \n 'Main Road 989'},  { _id: 58fdbf5c0ef8a50b4cdd9a91 , name: 'Viola', address: 'Sideway \n 1633'}]\n\n\nFind Some\nThe second parameter of the find() method \nis the projection object that describes which fields to include in the result.\nThis parameter is optional, and if omitted, all fields will be included in \nthe result.\n\nExample\nReturn the fields \"name\" and \"address\" of all documents in the customers collection:\n\n var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection(\"customers\").find({}, { projection: { _id: 0, name: 1, address: \n 1 } }).toArray(function(err, result) {    \n if (err) throw err;    console.log(result);    \n db.close();  });});\nRun example »\n\nSave the code above in a file called \"demo_mongodb_find_fields.js\" and run the file:\n\nRun \"demo_mongodb_find_fields.js\"\n\nC:\\Users\\Your Name>node demo_mongodb_find_fields.js\n\n\nWhich will give you this result:\n\n[  { name: 'John', address: 'Highway 71'},  { name: 'Peter', address: 'Lowstreet 4'},  { \n name: 'Amy', \n address: 'Apple st 652'},  { name: 'Hannah', address: \n 'Mountain 21'},  { name: 'Michael', address: 'Valley 345'},  \n { name: 'Sandy', address: 'Ocean blvd 2'},  { \n name: 'Betty', address: 'Green Grass 1'},  { name: 'Richard', \n address: 'Sky st 331'},  { name: 'Susan', address: 'One way \n 98'},  { name: 'Vicky', address: 'Yellow Garden 2'},  \n { name: 'Ben', address: 'Park Lane 38'},  { \n name: 'William', \n address: 'Central st 954'},  { name: 'Chuck', address: \n 'Main Road 989'},  { name: 'Viola', address: 'Sideway \n 1633'}]\n\n\nYou are not allowed to specify both 0 and 1 values in the same object (except \nif one of the fields is the _id field). If you specify a field with the value 0, all other fields get the value 1, \nand vice versa:\n\n\nExample\nThis example will exclude \"address\" from the result:\n\n var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection(\"customers\").find({}, { projection: { address: 0 \n } }).toArray(function(err, result) {    \n if (err) throw err;    console.log(result);    \n db.close();  });});\nRun example »\n\n\nTo exclude the _id field, you must set its value to 0:\n\n\nExample\nThis example will return only the \"name\" field:\n\n var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection(\"customers\").find({}, { projection: { _id: 0, name: 1 \n } }).toArray(function(err, result) {    \n if (err) throw err;    console.log(result);    \n db.close();  });});\nRun example »\n\n\nExample\nThis example will give you the same result as the first example; return all \nfields except the _id field:\n\n var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection(\"customers\").find({}, { projection: { _id: 0 \n } }).toArray(function(err, result) {    \n if (err) throw err;    console.log(result);    \n db.close();  });});\nRun example »\n\n\nExample\nYou get an error if you specify both 0 and 1 values in the same object \n(except if one of the fields is the _id field):\n\n var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection(\"customers\").find({}, { projection: { name: 1, address: 0 \n } }).toArray(function(err, result) {    \n if (err) throw err;    console.log(result);    \n db.close();  });});\nRun example »\n\n\nThe Result Object\nAs you can see from the result of the example above, the result can be converted into an array containing each \ndocument as an object.\nTo return e.g. the address of the third document, just refer to the third array \nobject's address property:\n\nExample\nReturn the address of the third document:\n\n console.log(result[2].address);\n\nWhich will produce this result:\n\n\n Apple st 652\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;\n var url = \"mongodb://localhost:27017/\";MongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  dbo.collection(\"customers\").findOne({}, function(err, result) {    if (err) throw err;    console.log(result.name);    db.close();  \n });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_mongodb_findone.js" + }, + { + "language": "javascript", + "code": "Company Inc." + }, + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection(\"customers\").find({}).toArray(function(err, result) {    \n if (err) throw err;    console.log(result);    \n db.close();  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_mongodb_find.js" + }, + { + "language": "javascript", + "code": "[  { _id: \n 58fdbf5c0ef8a50b4cdd9a84 , name: 'John', address: 'Highway 71'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a85 , name: 'Peter', address: 'Lowstreet 4'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a86 , name: 'Amy', \n address: 'Apple st 652'},  { _id: 58fdbf5c0ef8a50b4cdd9a87 , name: 'Hannah', address: \n 'Mountain 21'},  { _id: 58fdbf5c0ef8a50b4cdd9a88 , name: 'Michael', address: 'Valley 345'},  \n { _id: 58fdbf5c0ef8a50b4cdd9a89 , name: 'Sandy', address: 'Ocean blvd 2'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a8a , \n name: 'Betty', address: 'Green Grass 1'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a8b , name: 'Richard', \n address: 'Sky st 331'},  { _id: 58fdbf5c0ef8a50b4cdd9a8c , name: 'Susan', address: 'One way \n 98'},  { _id: 58fdbf5c0ef8a50b4cdd9a8d , name: 'Vicky', address: 'Yellow Garden 2'},  \n { _id: 58fdbf5c0ef8a50b4cdd9a8e , name: 'Ben', address: 'Park Lane 38'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a8f , name: 'William', \n address: 'Central st 954'},  { _id: 58fdbf5c0ef8a50b4cdd9a90 , name: 'Chuck', address: \n 'Main Road 989'},  { _id: 58fdbf5c0ef8a50b4cdd9a91 , name: 'Viola', address: 'Sideway \n 1633'}]" + }, + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection(\"customers\").find({}, { projection: { _id: 0, name: 1, address: \n 1 } }).toArray(function(err, result) {    \n if (err) throw err;    console.log(result);    \n db.close();  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_mongodb_find_fields.js" + }, + { + "language": "javascript", + "code": "[  { name: 'John', address: 'Highway 71'},  { name: 'Peter', address: 'Lowstreet 4'},  { \n name: 'Amy', \n address: 'Apple st 652'},  { name: 'Hannah', address: \n 'Mountain 21'},  { name: 'Michael', address: 'Valley 345'},  \n { name: 'Sandy', address: 'Ocean blvd 2'},  { \n name: 'Betty', address: 'Green Grass 1'},  { name: 'Richard', \n address: 'Sky st 331'},  { name: 'Susan', address: 'One way \n 98'},  { name: 'Vicky', address: 'Yellow Garden 2'},  \n { name: 'Ben', address: 'Park Lane 38'},  { \n name: 'William', \n address: 'Central st 954'},  { name: 'Chuck', address: \n 'Main Road 989'},  { name: 'Viola', address: 'Sideway \n 1633'}]" + }, + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection(\"customers\").find({}, { projection: { address: 0 \n } }).toArray(function(err, result) {    \n if (err) throw err;    console.log(result);    \n db.close();  });});" + }, + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection(\"customers\").find({}, { projection: { _id: 0, name: 1 \n } }).toArray(function(err, result) {    \n if (err) throw err;    console.log(result);    \n db.close();  });});" + }, + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection(\"customers\").find({}, { projection: { _id: 0 \n } }).toArray(function(err, result) {    \n if (err) throw err;    console.log(result);    \n db.close();  });});" + }, + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection(\"customers\").find({}, { projection: { name: 1, address: 0 \n } }).toArray(function(err, result) {    \n if (err) throw err;    console.log(result);    \n db.close();  });});" + }, + { + "language": "javascript", + "code": "console.log(result[2].address);" + }, + { + "language": "javascript", + "code": "Apple st 652" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_query.asp", + "content": "Node.js MongoDB Query\n\n❮ Previous\nNext ❯\n\n\nFilter the Result\nWhen finding documents in a collection, you can filter the result by using a \nquery object.\nThe first argument of the find() method \nis a query object, and is used to limit the search.\n\nExample\nFind documents with the address \"Park Lane 38\":\n\n var MongoClient = require('mongodb').MongoClient;\n var url = \"mongodb://localhost:27017/\";MongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");\n  var query = { address: \"Park Lane 38\" };  dbo.collection(\"customers\").find(query).toArray(function(err, result) {    if (err) throw err;    console.log(result);    db.close();  \n });});\nRun example »\n\nSave the code above in a file called \"demo_mongodb_query.js\" and run the file:\n\nRun \"demo_mongodb_query.js\"\n\nC:\\Users\\Your Name>node demo_mongodb_query.js\n\n\nWhich will give you this result:\n\n[  { _id: 58fdbf5c0ef8a50b4cdd9a8e \n , name: 'Ben', address: 'Park Lane 38' }]\n\n\n\n\n\n\n\nFilter With Regular Expressions\nYou can write regular expressions to find exactly what you are searching for.\n\nRegular expressions can only be used to query strings.\n\nTo find only the documents where the \"address\" field starts with the letter \"S\", use the regular \nexpression /^S/:\n\nExample\nFind documents where the address starts with the letter \"S\":\n\n var MongoClient = require('mongodb').MongoClient;\n var url = \"mongodb://localhost:27017/\";MongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");\n   var query = { address: /^S/ };  dbo.collection(\"customers\").find(query).toArray(function(err, result) {    if (err) throw err;    console.log(result);    db.close();  \n });});\nRun example »\n\nSave the code above in a file called \"demo_mongodb_query_s.js\" and run the file:\n\nRun \"demo_mongodb_query_s.js\"\n\nC:\\Users\\Your Name>node demo_mongodb_query_s.js\n\n\nWhich will give you this result:\n\n[  { _id: \n 58fdbf5c0ef8a50b4cdd9a8b , name: 'Richard', \n address: 'Sky st 331' },  { _id: 58fdbf5c0ef8a50b4cdd9a91 , name: 'Viola', address: 'Sideway \n 1633' }]\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;\n var url = \"mongodb://localhost:27017/\";MongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");\n  var query = { address: \"Park Lane 38\" };  dbo.collection(\"customers\").find(query).toArray(function(err, result) {    if (err) throw err;    console.log(result);    db.close();  \n });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_mongodb_query.js" + }, + { + "language": "javascript", + "code": "[  { _id: 58fdbf5c0ef8a50b4cdd9a8e \n , name: 'Ben', address: 'Park Lane 38' }]" + }, + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;\n var url = \"mongodb://localhost:27017/\";MongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");\n   var query = { address: /^S/ };  dbo.collection(\"customers\").find(query).toArray(function(err, result) {    if (err) throw err;    console.log(result);    db.close();  \n });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_mongodb_query_s.js" + }, + { + "language": "javascript", + "code": "[  { _id: \n 58fdbf5c0ef8a50b4cdd9a8b , name: 'Richard', \n address: 'Sky st 331' },  { _id: 58fdbf5c0ef8a50b4cdd9a91 , name: 'Viola', address: 'Sideway \n 1633' }]" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_sort.asp", + "content": "Node.js MongoDB Sort\n\n❮ Previous\nNext ❯\n\n\nSort the Result\nUse the sort() method to sort the result in ascending or descending order.\nThe sort() method takes one parameter, an \nobject defining the sorting order.\n\nExample\nSort the result alphabetically by name:\n\n var MongoClient = require('mongodb').MongoClient;\n var url = \"mongodb://localhost:27017/\";MongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");\n  var mysort = { name: 1 };  dbo.collection(\"customers\").find().sort(mysort).toArray(function(err, result) {    if (err) throw err;    console.log(result);    db.close();  \n });});\nRun example »\n\nSave the code above in a file called \"demo_sort.js\" and run the file:\n\nRun \"demo_sort.js\"\n\nC:\\Users\\Your Name>node demo_sort.js\n\n\nWhich will give you this result:\n\n[  { \n _id: 58fdbf5c0ef8a50b4cdd9a86, name: 'Amy', \n address: 'Apple st 652'},  \n { _id: 58fdbf5c0ef8a50b4cdd9a8e, name: 'Ben', address: 'Park Lane 38'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a8a, \n name: 'Betty', address: 'Green Grass 1'},  { _id: 58fdbf5c0ef8a50b4cdd9a90, name: 'Chuck', address: \n 'Main Road 989'},  { _id: 58fdbf5c0ef8a50b4cdd9a87, name: 'Hannah', address: \n 'Mountain 21'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a84, name: 'John', address: 'Highway 71'},  { _id: 58fdbf5c0ef8a50b4cdd9a88, name: 'Michael', address: 'Valley 345'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a85, name: 'Peter', address: 'Lowstreet 4'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a8b, name: 'Richard', \n address: 'Sky st 331'},  \n { _id: 58fdbf5c0ef8a50b4cdd9a89, name: 'Sandy', address: 'Ocean blvd 2'},  { _id: 58fdbf5c0ef8a50b4cdd9a8c, name: 'Susan', address: 'One way \n 98'},  { _id: 58fdbf5c0ef8a50b4cdd9a8d, name: 'Vicky', address: 'Yellow Garden 2'},  { _id: 58fdbf5c0ef8a50b4cdd9a91, name: 'Viola', address: 'Sideway \n 1633'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a8f, name: 'William', \n address: 'Central st 954'}]\n\n\n\n\n\n\n\nSort Descending\nUse the value -1 in the sort object to sort descending.\n\n{ name: 1 } // ascending{ name: -1 } // descending\n\n\nExample\nSort the result reverse alphabetically by name:\n\n var MongoClient = require('mongodb').MongoClient;\n var url = \"mongodb://localhost:27017/\";MongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");\n  var mysort = { name: -1 };  dbo.collection(\"customers\").find().sort(mysort).toArray(function(err, result) {    if (err) throw err;    console.log(result);    db.close();  \n });});\nRun example »\n\nSave the code above in a file called \"demo_sort_desc.js\" and run the file:\n\nRun \"demo_sort_desc.js\"\n\nC:\\Users\\Your Name>node demo_sort_desc.js\n\n\nWhich will give you this result:\n\n[  { \n _id: 58fdbf5c0ef8a50b4cdd9a8f, name: 'William', \n address: 'Central st 954'},  { _id: 58fdbf5c0ef8a50b4cdd9a91, name: 'Viola', address: 'Sideway \n 1633'},  { _id: 58fdbf5c0ef8a50b4cdd9a8d, name: 'Vicky', address: 'Yellow Garden 2'},  { _id: 58fdbf5c0ef8a50b4cdd9a8c, name: 'Susan', address: 'One way \n 98'},  \n { _id: 58fdbf5c0ef8a50b4cdd9a89, name: 'Sandy', address: 'Ocean blvd 2'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a8b, name: 'Richard', \n address: 'Sky st 331'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a85, name: 'Peter', address: 'Lowstreet 4'},  { _id: 58fdbf5c0ef8a50b4cdd9a88, name: 'Michael', address: 'Valley 345'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a84, name: 'John', address: 'Highway 71'},  { _id: 58fdbf5c0ef8a50b4cdd9a87, name: 'Hannah', address: \n 'Mountain 21'},  { _id: 58fdbf5c0ef8a50b4cdd9a90, name: 'Chuck', address: \n 'Main Road 989'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a8a, \n name: 'Betty', address: 'Green Grass 1'},  \n { _id: 58fdbf5c0ef8a50b4cdd9a8e, name: 'Ben', address: 'Park Lane 38'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a86, name: 'Amy', \n address: 'Apple st 652'}]\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;\n var url = \"mongodb://localhost:27017/\";MongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");\n  var mysort = { name: 1 };  dbo.collection(\"customers\").find().sort(mysort).toArray(function(err, result) {    if (err) throw err;    console.log(result);    db.close();  \n });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_sort.js" + }, + { + "language": "javascript", + "code": "[  { \n _id: 58fdbf5c0ef8a50b4cdd9a86, name: 'Amy', \n address: 'Apple st 652'},  \n { _id: 58fdbf5c0ef8a50b4cdd9a8e, name: 'Ben', address: 'Park Lane 38'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a8a, \n name: 'Betty', address: 'Green Grass 1'},  { _id: 58fdbf5c0ef8a50b4cdd9a90, name: 'Chuck', address: \n 'Main Road 989'},  { _id: 58fdbf5c0ef8a50b4cdd9a87, name: 'Hannah', address: \n 'Mountain 21'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a84, name: 'John', address: 'Highway 71'},  { _id: 58fdbf5c0ef8a50b4cdd9a88, name: 'Michael', address: 'Valley 345'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a85, name: 'Peter', address: 'Lowstreet 4'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a8b, name: 'Richard', \n address: 'Sky st 331'},  \n { _id: 58fdbf5c0ef8a50b4cdd9a89, name: 'Sandy', address: 'Ocean blvd 2'},  { _id: 58fdbf5c0ef8a50b4cdd9a8c, name: 'Susan', address: 'One way \n 98'},  { _id: 58fdbf5c0ef8a50b4cdd9a8d, name: 'Vicky', address: 'Yellow Garden 2'},  { _id: 58fdbf5c0ef8a50b4cdd9a91, name: 'Viola', address: 'Sideway \n 1633'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a8f, name: 'William', \n address: 'Central st 954'}]" + }, + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;\n var url = \"mongodb://localhost:27017/\";MongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");\n  var mysort = { name: -1 };  dbo.collection(\"customers\").find().sort(mysort).toArray(function(err, result) {    if (err) throw err;    console.log(result);    db.close();  \n });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_sort_desc.js" + }, + { + "language": "javascript", + "code": "[  { \n _id: 58fdbf5c0ef8a50b4cdd9a8f, name: 'William', \n address: 'Central st 954'},  { _id: 58fdbf5c0ef8a50b4cdd9a91, name: 'Viola', address: 'Sideway \n 1633'},  { _id: 58fdbf5c0ef8a50b4cdd9a8d, name: 'Vicky', address: 'Yellow Garden 2'},  { _id: 58fdbf5c0ef8a50b4cdd9a8c, name: 'Susan', address: 'One way \n 98'},  \n { _id: 58fdbf5c0ef8a50b4cdd9a89, name: 'Sandy', address: 'Ocean blvd 2'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a8b, name: 'Richard', \n address: 'Sky st 331'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a85, name: 'Peter', address: 'Lowstreet 4'},  { _id: 58fdbf5c0ef8a50b4cdd9a88, name: 'Michael', address: 'Valley 345'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a84, name: 'John', address: 'Highway 71'},  { _id: 58fdbf5c0ef8a50b4cdd9a87, name: 'Hannah', address: \n 'Mountain 21'},  { _id: 58fdbf5c0ef8a50b4cdd9a90, name: 'Chuck', address: \n 'Main Road 989'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a8a, \n name: 'Betty', address: 'Green Grass 1'},  \n { _id: 58fdbf5c0ef8a50b4cdd9a8e, name: 'Ben', address: 'Park Lane 38'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a86, name: 'Amy', \n address: 'Apple st 652'}]" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_delete.asp", + "content": "Node.js MongoDB Delete\n\n❮ Previous\nNext ❯\n\n\nDelete Document\nTo delete a record, or document as it is called in MongoDB, we use the\ndeleteOne() method.\nThe first parameter of the deleteOne() method \nis a query object defining which document to delete.\n\nNote: If the query finds more than one document, only the first \noccurrence is deleted.\n\n\nExample\nDelete the document with the address \"Mountain 21\":\n\n var MongoClient = require('mongodb').MongoClient;\n var url = \"mongodb://localhost:27017/\";\n MongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");\n  var myquery = { address: 'Mountain 21' };  \n dbo.collection(\"customers\").deleteOne(myquery, function(err, obj) {    \n if (err) throw err;    console.log(\"1 \n document deleted\");    db.close();  });});\nRun example »\n\nSave the code above in a file called \"demo_delete.js\" and run the file:\n\nRun \"demo_delete.js\"\n\nC:\\Users\\Your Name>node demo_delete.js\n\n\nWhich will give you this result:\n\n1 document deleted\n\n\n\n\n\n\n\nDelete Many\nTo delete more than one document, use the\ndeleteMany() method.\nThe first parameter of the deleteMany() method \nis a query object defining which documents to delete.\n\nExample\nDelete all documents were the address starts with the letter \"O\":\n\n var MongoClient = require('mongodb').MongoClient;\n var url = \"mongodb://localhost:27017/\";\n MongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");\n  var myquery = { address: /^O/ };  \n dbo.collection(\"customers\").deleteMany(myquery, function(err, obj) {    \n if (err) throw err;    console.log(obj.result.n + \" \n document(s) deleted\");    db.close();  });});\nRun example »\n\nSave the code above in a file called \"demo_delete_many.js\" and run the file:\n\nRun \"demo_delete_many.js\"\n\nC:\\Users\\Your Name>node demo_delete_many.js\n\n\nWhich will give you this result:\n\n2 document(s) deleted\n\n\nThe Result Object\nThe deleteMany() method returns an object which contains information about how \nthe execution affected the database.\nMost of the information is not important to understand, but one object inside \nthe object is called \"result\" which tells us if the execution went OK, and how \nmany documents were affected.\nThe result object looks like this:\n\n\n { n: 2, ok: 1 }\n\nYou can use this object to return the number of deleted documents:\n\nExample\nReturn the number of deleted documents:\n\n console.log(obj.result.n);\n\nWhich will produce this result:\n\n\n 2\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;\n var url = \"mongodb://localhost:27017/\";\n MongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");\n  var myquery = { address: 'Mountain 21' };  \n dbo.collection(\"customers\").deleteOne(myquery, function(err, obj) {    \n if (err) throw err;    console.log(\"1 \n document deleted\");    db.close();  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_delete.js" + }, + { + "language": "javascript", + "code": "1 document deleted" + }, + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;\n var url = \"mongodb://localhost:27017/\";\n MongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");\n  var myquery = { address: /^O/ };  \n dbo.collection(\"customers\").deleteMany(myquery, function(err, obj) {    \n if (err) throw err;    console.log(obj.result.n + \" \n document(s) deleted\");    db.close();  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_delete_many.js" + }, + { + "language": "javascript", + "code": "2 document(s) deleted" + }, + { + "language": "javascript", + "code": "{ n: 2, ok: 1 }" + }, + { + "language": "javascript", + "code": "console.log(obj.result.n);" + }, + { + "language": "javascript", + "code": "2" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_drop.asp", + "content": "Node.js MongoDB Drop\n\n❮ Previous\nNext ❯\n\n\nDrop Collection\nYou can delete a table, or collection as it is called in MongoDB, by using \nthe drop() method.\nThe drop() method takes a callback function \ncontaining the error object and the result parameter which returns true if the collection was dropped successfully, \notherwise it returns false.\n\nExample\nDelete the \"customers\" table:\n\n var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection(\"customers\").drop(function(err, delOK) {    \n if (err) throw err;    if (delOK) console.log(\"Collection \n deleted\");    db.close();  });});\nRun example »\n\nSave the code above in a file called \"demo_drop.js\" and run the file:\n\nRun \"demo_drop.js\"\n\nC:\\Users\\Your Name>node demo_drop.js\n\n\nWhich will give you this result:\n\nCollection deleted\n\n\n\n\n\n\n\ndb.dropCollection\nYou can also use the dropCollection() method to delete a table (collection).\nThe dropCollection() method takes two parameters: the name of the collection \nand a callback function.\n\nExample\nDelete the \"customers\" collection, using dropCollection():\n\n var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.dropCollection(\"customers\", function(err, delOK) {    \n if (err) throw err;    if (delOK) console.log(\"Collection \n deleted\");    db.close();  });});\nRun example »\n\nSave the code above in a file called \"demo_dropcollection.js\" and run the file:\n\nRun \"demo_dropcollection.js\"\n\nC:\\Users\\Your Name>node demo_dropcollection.js\n\n\nWhich will give you this result:\n\nCollection deleted\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection(\"customers\").drop(function(err, delOK) {    \n if (err) throw err;    if (delOK) console.log(\"Collection \n deleted\");    db.close();  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_drop.js" + }, + { + "language": "javascript", + "code": "Collection deleted" + }, + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.dropCollection(\"customers\", function(err, delOK) {    \n if (err) throw err;    if (delOK) console.log(\"Collection \n deleted\");    db.close();  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_dropcollection.js" + }, + { + "language": "javascript", + "code": "Collection deleted" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_update.asp", + "content": "Node.js MongoDB Update\n\n❮ Previous\nNext ❯\n\n\nUpdate Document\nYou can update a record, or document as it is called in MongoDB, by using \nthe updateOne() method.\nThe first parameter of the updateOne() method \nis a query object defining which document to update.\n\nNote: If the query finds more than one record, only the first \noccurrence is updated.\n\nThe second parameter \nis an object defining the new values of the document.\n\nExample\nUpdate the document with the address \"Valley 345\" to name=\"Mickey\" and \naddress=\"Canyon 123\":\n\n var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://127.0.0.1:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n var myquery = { address: \"Valley 345\" };  var newvalues = { \n $set: {name: \n \"Mickey\", address: \"Canyon 123\" } };  dbo.collection(\"customers\").updateOne(myquery, \n newvalues, function(err, res) {    if (err) throw err;    \n console.log(\"1 document updated\");    \n db.close();  });});\nRun example »\n\nSave the code above in a file called \"demo_update_one.js\" and run the file:\n\nRun \"demo_update_one.js\"\n\nC:\\Users\\Your Name>node demo_update_one.js\n\n\nWhich will give you this result:\n\n1 document updated\n\n\n\n\n\n\n\nUpdate Only Specific Fields\nWhen using the $set operator, only the \nspecified fields are updated:\n\nExample\nUpdate the address from \"Valley 345\" to \"Canyon 123\":\n\n ...  var myquery = { address: \"Valley 345\" };  var newvalues \n = { $set: { address: \"Canyon 123\" } };  dbo.collection(\"customers\").updateOne(myquery, \n newvalues, function(err, res) {...\nRun example »\n\n\nUpdate Many Documents\nTo update all documents that meets the criteria of the query, use \nthe updateMany() method.\n\nExample\nUpdate all documents where the name starts with the letter \"S\":\n\n var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://127.0.0.1:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n var myquery = { address: /^S/ };  var newvalues = {$set: {name: \n \"Minnie\"} };  \n dbo.collection(\"customers\").updateMany(myquery, newvalues, function(err, \n res) {    if (err) throw err;    \n console.log(res.result.nModified + \" document(s) updated\");    \n db.close();  });});\nRun example »\n\nSave the code above in a file called \"demo_update_many.js\" and run the file:\n\nRun \"demo_update_many.js\"\n\nC:\\Users\\Your Name>node demo_update_many.js\n\n\nWhich will give you this result:\n\n2 document(s) updated\n\n\nThe Result Object\nThe updateOne() and the\nupdateMany() methods return an object which contains information about how \nthe execution affected the database.\nMost of the information is not important to understand, but one object inside \nthe object is called \"result\" which tells us if the execution went OK, and how \nmany documents were affected.\nThe result object looks like this:\n\n\n { n: 1, nModified: 2, ok: 1 }\n\nYou can use this object to return the number of updated documents:\n\nExample\nReturn the number of updated documents:\n\n console.log(res.result.nModified);\n\nWhich will produce this result:\n\n\n 2\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://127.0.0.1:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n var myquery = { address: \"Valley 345\" };  var newvalues = { \n $set: {name: \n \"Mickey\", address: \"Canyon 123\" } };  dbo.collection(\"customers\").updateOne(myquery, \n newvalues, function(err, res) {    if (err) throw err;    \n console.log(\"1 document updated\");    \n db.close();  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_update_one.js" + }, + { + "language": "javascript", + "code": "1 document updated" + }, + { + "language": "javascript", + "code": "...  var myquery = { address: \"Valley 345\" };  var newvalues \n = { $set: { address: \"Canyon 123\" } };  dbo.collection(\"customers\").updateOne(myquery, \n newvalues, function(err, res) {..." + }, + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://127.0.0.1:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n var myquery = { address: /^S/ };  var newvalues = {$set: {name: \n \"Minnie\"} };  \n dbo.collection(\"customers\").updateMany(myquery, newvalues, function(err, \n res) {    if (err) throw err;    \n console.log(res.result.nModified + \" document(s) updated\");    \n db.close();  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_update_many.js" + }, + { + "language": "javascript", + "code": "2 document(s) updated" + }, + { + "language": "javascript", + "code": "{ n: 1, nModified: 2, ok: 1 }" + }, + { + "language": "javascript", + "code": "console.log(res.result.nModified);" + }, + { + "language": "javascript", + "code": "2" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_limit.asp", + "content": "Node.js MongoDB Limit\n\n❮ Previous\nNext ❯\n\n\nLimit the Result\nTo limit the result in MongoDB, we use the limit() \nmethod.\nThe limit() method takes one parameter, a number defining how many documents \nto return.\nConsider you have a \"customers\" collection:\n\ncustomers\n[  { _id: \n 58fdbf5c0ef8a50b4cdd9a84 , name: 'John', address: 'Highway 71'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a85 , name: 'Peter', address: 'Lowstreet 4'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a86 , name: 'Amy', \n address: 'Apple st 652'},  { _id: 58fdbf5c0ef8a50b4cdd9a87 , name: 'Hannah', address: \n 'Mountain 21'},  { _id: 58fdbf5c0ef8a50b4cdd9a88 , name: 'Michael', address: 'Valley 345'},  \n { _id: 58fdbf5c0ef8a50b4cdd9a89 , name: 'Sandy', address: 'Ocean blvd 2'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a8a , \n name: 'Betty', address: 'Green Grass 1'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a8b , name: 'Richard', \n address: 'Sky st 331'},  { _id: 58fdbf5c0ef8a50b4cdd9a8c , name: 'Susan', address: 'One way \n 98'},  { _id: 58fdbf5c0ef8a50b4cdd9a8d , name: 'Vicky', address: 'Yellow Garden 2'},  \n { _id: 58fdbf5c0ef8a50b4cdd9a8e , name: 'Ben', address: 'Park Lane 38'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a8f , name: 'William', \n address: 'Central st 954'},  { _id: 58fdbf5c0ef8a50b4cdd9a90 , name: 'Chuck', address: \n 'Main Road 989'},  { _id: 58fdbf5c0ef8a50b4cdd9a91 , name: 'Viola', address: 'Sideway \n 1633'}]\n\n\nExample\nLimit the result to only return 5 documents:\n\n var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection(\"customers\").find().limit(5).toArray(function(err, result) {    \n if (err) throw err;    console.log(result);    \n db.close();  });});\nRun example »\n\nSave the code above in a file called \"demo_mongodb_limit.js\" and run the file:\n\nRun \"demo_mongodb_limit.js\"\n\nC:\\Users\\Your Name>node demo_mongodb_limit.js\n\n\nWhich will give you this result:\n\ncustomers\n[  { _id: \n 58fdbf5c0ef8a50b4cdd9a84 , name: 'John', address: 'Highway 71'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a85 , name: 'Peter', address: 'Lowstreet 4'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a86 , name: 'Amy', \n address: 'Apple st 652'},  { _id: 58fdbf5c0ef8a50b4cdd9a87 , name: 'Hannah', address: \n 'Mountain 21'},  { _id: 58fdbf5c0ef8a50b4cdd9a88 , name: 'Michael', \n address: 'Valley 345'}]\n\nAs you can see from the result above, only the 5 first documents were \nreturned.\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "[  { _id: \n 58fdbf5c0ef8a50b4cdd9a84 , name: 'John', address: 'Highway 71'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a85 , name: 'Peter', address: 'Lowstreet 4'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a86 , name: 'Amy', \n address: 'Apple st 652'},  { _id: 58fdbf5c0ef8a50b4cdd9a87 , name: 'Hannah', address: \n 'Mountain 21'},  { _id: 58fdbf5c0ef8a50b4cdd9a88 , name: 'Michael', address: 'Valley 345'},  \n { _id: 58fdbf5c0ef8a50b4cdd9a89 , name: 'Sandy', address: 'Ocean blvd 2'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a8a , \n name: 'Betty', address: 'Green Grass 1'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a8b , name: 'Richard', \n address: 'Sky st 331'},  { _id: 58fdbf5c0ef8a50b4cdd9a8c , name: 'Susan', address: 'One way \n 98'},  { _id: 58fdbf5c0ef8a50b4cdd9a8d , name: 'Vicky', address: 'Yellow Garden 2'},  \n { _id: 58fdbf5c0ef8a50b4cdd9a8e , name: 'Ben', address: 'Park Lane 38'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a8f , name: 'William', \n address: 'Central st 954'},  { _id: 58fdbf5c0ef8a50b4cdd9a90 , name: 'Chuck', address: \n 'Main Road 989'},  { _id: 58fdbf5c0ef8a50b4cdd9a91 , name: 'Viola', address: 'Sideway \n 1633'}]" + }, + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://localhost:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection(\"customers\").find().limit(5).toArray(function(err, result) {    \n if (err) throw err;    console.log(result);    \n db.close();  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_mongodb_limit.js" + }, + { + "language": "javascript", + "code": "[  { _id: \n 58fdbf5c0ef8a50b4cdd9a84 , name: 'John', address: 'Highway 71'},  { _id: \n 58fdbf5c0ef8a50b4cdd9a85 , name: 'Peter', address: 'Lowstreet 4'},  { \n _id: 58fdbf5c0ef8a50b4cdd9a86 , name: 'Amy', \n address: 'Apple st 652'},  { _id: 58fdbf5c0ef8a50b4cdd9a87 , name: 'Hannah', address: \n 'Mountain 21'},  { _id: 58fdbf5c0ef8a50b4cdd9a88 , name: 'Michael', \n address: 'Valley 345'}]" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_mongodb_join.asp", + "content": "Node.js MongoDB Join\n\n❮ Previous\nNext ❯\n\n\nJoin Collections\nMongoDB is not a relational database, but you can perform a left outer join \nby using the $lookup stage.\nThe $lookup stage lets you specify which \ncollection you want to join with the current collection, and which \nfields that should match.\nConsider you have a \"orders\" collection and a \"products\" collection:\n\norders\n[  { _id: 1, product_id: \n 154, status: 1 }]\n\n\nproducts\n[  { _id: 154, name: \n 'Chocolate Heaven' },  { _id: 155, name: 'Tasty Lemons' },  { \n _id: 156, name: 'Vanilla Dreams' }]\n\n\nExample\nJoin the matching \"products\" document(s) to the \"orders\" collection:\n\n var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://127.0.0.1:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection('orders').aggregate([    { $lookup:       \n {         from: 'products',         \n localField: 'product_id',         \n foreignField: '_id',         \n as: 'orderdetails'       }     \n }    ]).toArray(function(err, \n res) {    if (err) throw err;    \n console.log(JSON.stringify(res));    \n db.close();  });});\nRun example »\n\nSave the code above in a file called \"demo_mongodb_join.js\" and run the file:\n\nRun \"demo_mongodb_join.js\"\n\nC:\\Users\\Your Name>node demo_mongodb_join.js\n\n\nWhich will give you this result:\n\n[  { \"_id\": 1, \"product_id\": \n 154, \"status\": 1, \"orderdetails\": [    { \"_id\": 154, \"name\": \n \"Chocolate Heaven\" } ]  }]\n\nAs you can see from the result above, the matching document from the products \ncollection is included in the orders collection as an array.\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "[  { _id: 1, product_id: \n 154, status: 1 }]" + }, + { + "language": "javascript", + "code": "[  { _id: 154, name: \n 'Chocolate Heaven' },  { _id: 155, name: 'Tasty Lemons' },  { \n _id: 156, name: 'Vanilla Dreams' }]" + }, + { + "language": "javascript", + "code": "var MongoClient = require('mongodb').MongoClient;var url = \"mongodb://127.0.0.1:27017/\";\nMongoClient.connect(url, function(err, db) {  if (err) throw err;  \n var dbo = db.db(\"mydb\");  \n dbo.collection('orders').aggregate([    { $lookup:       \n {         from: 'products',         \n localField: 'product_id',         \n foreignField: '_id',         \n as: 'orderdetails'       }     \n }    ]).toArray(function(err, \n res) {    if (err) throw err;    \n console.log(JSON.stringify(res));    \n db.close();  });});" + }, + { + "language": "javascript", + "code": "C:\\Users\\Your Name>node demo_mongodb_join.js" + }, + { + "language": "javascript", + "code": "[  { \"_id\": 1, \"product_id\": \n 154, \"status\": 1, \"orderdetails\": [    { \"_id\": 154, \"name\": \n \"Chocolate Heaven\" } ]  }]" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_raspberrypi.asp", + "content": "Node.js and Raspberry Pi\n\n❮ Previous\nNext ❯\n\n\nRaspberry Pi is a small, multi-use computer.\nWith Node.js you can do amazing things with your Raspberry Pi.\n\nWhat is the Raspberry Pi?\nThe Raspberry Pi is a small, affordable, and amazingly capable, credit card \nsize computer.\nIt is developed by the Raspberry Pi Foundation, and it might be the most \nversatile tech ever created.\nCreator Eben Upton's goal was to create a low-cost device that would improve \nprogramming skills and hardware understanding.\nDue to the small size and price of the device, it has become the center of a \nwide range of projects by tinkerers, makers, and electronics enthusiasts.\n\nRaspberry Pi and Node.js\nThe Raspberry Pi has a row of GPIO (General Purpose input/output) pins, and \nthese can be used to interact in amazing ways with the real world. This tutorial \nwill focus on how to use these with Node.js.\n\nWhat Do I Need?\nFor this tutorial you need a Raspberry Pi. In our examples we use a Raspberry Pi 3, \nbut this tutorial should work for most versions.\nHardware needed:\n\nRaspberry Pi computer\nMicroSD memory card (We recommend a class 10 with 16 GB or higher)\nMicroSD to SD memory card adapter (usually included with the MicroSD card)\nMicro USB power supply to power the Raspberry Pi (2.5A or greater \n recommended)\nWiFi/Ethernet Cable connection for the Raspberry Pi (Not needed for \n Raspberry Pi 3 as it has built in WiFi)\nA working computer with internet and SD memory card reader (used to get the OS \n (Operating System) for the Raspberry Pi onto the memory card). In our tutorial \n we use a Windows computer for this, but you can use a Mac or Linux computer if \n you prefer\nHDMI monitor, USB keyboard (we need these only temporarily for the first \n boot of the Raspberry Pi)\n\nFor later chapters in this tutorial we will use special sensors or devices \nthat we connect to the Raspberry Pi. We will specify these as special \nrequirements in the relevant chapters.\nIf you already have a Raspberry Pi set up with Raspbian, internet and enabled \nSSH, you can skip to the step \"Install Node.js on Raspberry Pi\".\n\nWrite Raspbian OS Image to MicroSD Card\nBefore we can start using our Raspberry Pi for anything, we need to get a OS \ninstalled.\nRaspbian is a free operating system based on Debian Linux, and it is \noptimized Raspberry Pi.\nDownload the latest Raspbian image from https://www.raspberrypi.org/downloads/raspbian/ \nto your computer.\nWe use the \"LITE\" version in our tutorial, since we are setting the Raspberry \nPi up as a headless server (we will connect to it through SSH, without having a \nkeyboard/display connected to it). You can use whichever version you want, but \nthis tutorial is written with the \"LITE\" version as its focus.\nInsert the MicroSD memory card in your computer (via the SD adapter if \nneeded). \nOpen File Explorer to verify that it is operational.\nEtcher is a program for flashing images to memory cards. Download and \ninstall Etcher from: https://etcher.io/\nLaunch Etcher:\n\nClick \"Select image\" button and find the Raspbian zip file that \nyou downloaded.\nClick the \"Select drive\" button and specify the memory card as the target location.\nClick the \"Flash!\" button to write the image to the memory card.\nAfter Etcher is finished writing the image to the memory card, remove it from your computer.\n\nSet up Your Raspberry Pi\nTo get the Raspberry Pi ready to boot we need to:\n\nInsert the MicroSD memory card into the Raspberry Pi\nConnect the USB keyboard\nConnect the HDMI cable\nConnect the USB Wi-Fi adapter (or Ethernet cable). Skip this step if you \n are using a Raspberry Pi 3\nConnect the micro USB power supply\nThe Raspberry Pi should now be booting up\n\nWhen the Raspberry Pi is finished booting up, log in using username: pi and password: raspberry\n\nSet Up Network on the Raspberry Pi\nIf you will use a Ethernet cable to connect your Raspberry Pi to the \ninternet, you can skip this step.\nFor this section we will assume you have a Raspberry Pi 3, with built in \nWiFi.\nStart by scanning for wireless networks:\n\n pi@raspberrypi:~ $ \n sudo iwlist wlan0 scan\n\nThis will list all of the available WiFi networks. (It also confirms that \nyour WiFi is working)\nNow we need to open the wpa-supplicant file, to add the network you want to \nconnect to:\n\n pi@raspberrypi:~ $ sudo \n nano /etc/wpa_supplicant/wpa_supplicant.conf\nThis will open the file in the Nano editor. Add the following to the bottom \nof the file (change wifiName and wifiPassword with the actual network name and \npassword):\n\n network={  ssid=\"wifiName\"  psk=\"wifiPassword\"} \nPress \"Ctrl+x\" to save the code. Confirm with \"y\", and confirm the name with \"Enter\".\nAnd reboot the Raspberry Pi:\n\n pi@raspberrypi:~ $ sudo reboot\nAfter reboot, log in again, and confirm that the WiFi is connected and working:\n\n pi@raspberrypi:~ $ ifconfig wlan0\nIf the WiFi is working propery, the information displayed should include an \nIP address, similar to this:\n\n inet addr:192.168.1.50\nWrite down that IP address, as we will use it to connect to the Raspberry Pi \nvia SSH.\n\n\n\n\n\n\nEnable SSH, Change Hostname and Password\nNow your Raspberry Pi is connected to the internet, it is time to enable SSH.\nSSH allows you up use the Raspberry Pi without having a monitor and keyboard \nconnected to it.\n(You will need a SSH client for this on your non-Raspberry Pi computer. We use \nPuTTY for windows)\nOpen the Raspberry Pi Software Configuration Tool:\n\n pi@raspberrypi:~ $ sudo raspi-config\nYou should see a menu like this:\n\nSelect option 5 Interfacing Options:\n\nSelect option P2 SSH, to activate SSH:\n\nConfirm with YES, to activate SSH:\n\nSSH is now enabled, and you should be in the main menu again.\nSelect 1 Change User Password, and follow the instructions to change the password. Choose a secure password, but something you will remember:\n\nAfter you have finished changing the password, you should be back in the main menu.\nSelect 2 Hostname, and follow the instructions to change the hostname:\n\nAfter you have finished changing the hostname, you should be back in the main menu.\nNow we will close the menu and save the changes:\n\nWhen selecting Finish, you will get the option to reboot. Select Yes to reboot the Raspberry Pi.\n\nYou can now unplug the monitor and keyboard from the Raspberry Pi, and we can log in using out SSH client.\nOpen PuTTY, type in the IP address for your Raspberry Pi, and click Open:\n\nLog in using the username pi and the new password you specified.\nYou should now see a command line like this: (we used w3demopi as our hostname)\n\n pi@w3demopi:~ $\n\nYou are now able to run your Raspberry Pi in \"Headless-mode\", meaning you do not need a monitor or keyboard. And if you have a WiFi connection, you do not need a ethernet cable either, just the power cable!\n\nInstall Node.js on Raspberry Pi\nWith the Raspberry Pi properly set up, login in via SSH, and update your Raspberry Pi system packages to their latest versions.\nUpdate your system package list:\n\n pi@w3demopi:~ $ sudo apt-get update\n\nUpgrade all your installed packages to their latest version:\n\n pi@w3demopi:~ $ sudo apt-get dist-upgrade\n\n\nDoing this regularly will keep your Raspberry Pi installation up to date.\n\nTo download and install newest version of Node.js, use the following command:\n\n pi@w3demopi:~ $ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -\nNow install it by running:\n\n pi@w3demopi:~ $ sudo apt-get install -y nodejs\nCheck that the installation was successful, and the version number of \nNode.js with:\n\n pi@w3demopi:~ $ node -v\n\nGet Started with Raspberry Pi and Node.js\nNow you have a Raspberry Pi with Node.js installed!\nIf you want to learn more about Node.js, follow our tutorial:\nhttps://www.w3schools.com/nodejs/\nIn the next chapter we will get to know the GPIO and how to use it with \nNode.js.\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_raspberrypi_gpio_intro.asp", + "content": "Node.js Raspberry Pi - GPIO Introduction\n\n❮ Previous\nNext ❯\n\n\nWhat is GPIO?\nGPIO stands for General Purpose Input Output.\nThe Raspberry Pi has two rows of GPIO pins, which are connections between the \nRaspberry Pi, and the real world.\nOutput pins are like switches that the Raspberry Pi can turn on or off (like \nturning on/off a LED light). But it can also send a signal to another device.\nInput pins are like switches that you can turn on or off from the outside \nworld (like a on/off light switch). But it can also be a data from a sensor, or \na signal from another device.\nThat means that you can interact with the real world, and control devices and \nelectronics using the Raspberry PI and its GPIO pins!\n\nTaking a Closer Look at the GPIO Pins\n\nThis is an illustration of the Raspberry Pi 3.\nThe GPIO pins are the small \nred squares in two rows on the right side of the Raspberry Pi, on the actual Raspberry Pi they are small metal pins.\nThe Raspberry Pi 3 has 26 GPIO pins, the rest of the pins are power, ground \nor \"other\".\nThe pin placements correspond with the table below.\n\n\nRaspberry Pi B+, 2, 3 & Zero\n\n\n3V3\n1\n2\n5V\n\n\nGPIO 2\n3\n4\n5V\n\n\nGPIO 3\n5\n6\nGND\n\n\nGPIO 4\n7\n8\nGPIO 14\n\n\nGND\n9\n10\nGPIO 15\n\n\nGPIO 17\n11\n12\nGPIO 18\n\n\nGPIO 27\n13\n14\nGND\n\n\nGPIO 22\n15\n16\nGPIO 23\n\n\n3V3\n17\n18\nGPIO 24\n\n\nGPIO 10\n19\n20\nGND\n\n\nGPIO 9\n21\n22\nGPIO 25\n\n\nGPIO 11\n23\n24\nGPIO 8\n\n\nGND\n25\n26\nGPIO 7\n\n\nDNC\n27\n28\nDNC\n\n\nGPIO 5\n29\n30\nGND\n\n\nGPIO 6\n31\n32\nGPIO 12\n\n\nGPIO 13\n33\n34\nGND\n\n\nGPIO 19\n35\n36\nGPIO 16\n\n\nGPIO 26\n37\n38\nGPIO 20\n\n\nGND\n39\n40\nGPIO 21\n\n\n\n\nLegend\n\nPhysical Pin Number\nPower +\nGround\nUART\nI2C\nSPI\nGPIO\nDo Not Connect\n\n\n\n\n\n\n\n\n\nTaking a Closer Look at the Breadboard\nA breadboard is used for prototyping electronics, it allows you to create \ncircuits without soldering. It is basically a plastic board, with a grid of \ntie-points (holes). Inside the board there are metal strips connecting the \ndifferent tie-points in specific ways.\nIn the illustration below we have highlighted some of the sections with different colors. This is to show you how the grid is connected.\n\nThe different sections of the breadboard:\n\nOn the left, and right, side there are 2 columns of tie-points. All the \n tie points in each of these columns are connected.\nThe Power Bus - The columns highlighted with red. There are usually used \n to connect power to the Breadboard. Since the entire column is connected, \n you can connect power to any of the tie-points in the column.\nThe Ground Bus - The columns highlighted with blue. There are usually \n used to connect Ground to the Breadboard. Since the entire column is \n connected, you can connect ground to any of the tie-points in the column.\nRows of connected Tie-Points - The rows highlighted with green. The \n tie-points of each of these rows are connected, but not the entire row! The \n left side tie-points are connected (A-B-C-D-E), and the right side \n tie-points are connected (F-G-H-I-J).\nIn the center of the Breadboard there is a Trench, this separates the \n left and right rows. The width of the trench is designed so that many \n Integrated Circuits fit across it.\n\n\nInstall the onoff Module\nTo interface with the GPIO on the Raspberry Pi using Node.js, we will use a \nModule called \"onoff\".\nInstall the onoff module using npm:\n\n pi@w3demopi:~ $ npm install onoff\n\nNow onoff should be installed and we can interact with the GPIO of the Raspberry Pi.\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_raspberrypi_blinking_led.asp", + "content": "Node.js Raspberry Pi GPIO - Blinking LED\n\n❮ Previous\nNext ❯\n\n\nUsing the GPIO for Output\nIn this chapter we will use a Raspberry Pi and its GPIO to \nmake a LED blink.\nWe use Node.js with the onoff module to control the GPIO.\nTo get a LED light to turn on, we use a GPIO pin as \"Output\", and create a \nscript to turn it on and off (blinking).\n\n\nWhat do we need?\nIn this chapter we will create a simple example where \nwe control a LED light.\nFor this you need:\n\nA Raspberry Pi with Raspian, internet, SSH, with Node.js installed\nThe \n onoff module for Node.js\n1 x Breadboard\n1 x \n 68 Ohm resistor\n1 x \n Through Hole LED\n2 x \n Female to male jumper wires\n\nClick the links in the list above for descriptions of the different \ncomponents.\n\nNote: The resistor you need can be different from what we use depending on the type of LED you use. Most small LEDs only need a small resistor, around 200-500 ohms. It is generally not critical what exact value you use, but the smaller the value of the resistor, the brighter the LED will\nshine.\n\n\nBuilding the Circuit\nNow it is time to build the circuit on our Breadboard.\nIf you are new to electronics, we recommend you turn off the power for \nthe Raspberry Pi. And use an anti-static mat or a grounding strap to avoid \ndamaging it.\nShut down the Raspberry Pi properly with the command:\n\n pi@w3demopi:~ $ sudo shutdown -h now\n\nAfter the LEDs stop blinking on the Raspberry Pi, then pull out the power \nplug from the Raspberry Pi (or turn off the power strip it is connected to).\nJust pulling the plug without shutting down properly may cause corruption of the memory card.\n\nLook at the above illustration of the circuit.\n\nOn the Raspberry Pi, connect the female leg of the first jumper wire to \n Ground. You can use any GND pin. In this example we used Physical Pin 9 (GND, \n row 5, left column)\nOn the Breadboard, connect the male leg of the first jumper wire to \n the Ground Bus column on the right. That entire \n column of your breadboard is connected, so it doesn't matter which row. In \n this example we have attached it to row 1\nOn the Raspberry Pi, connect the female leg of the second jumper cable \n to a GPIO pin. In this example we used Physical Pin \n 7 (GPIO 4, row 4, left \n column)\nOn the Breadboard, connect the male leg of the second jumper wire to the \n Tie-Point row of your choice. In this example we connected it to row 5, \n column A\nOn the Breadboard, connect one leg of the resistor to the Ground Bus \n column on the right side. That entire column of your breadboard is \n connected, so it doesn't matter which row. In this example we have attached \n it to row 5\nOn the Breadboard, connect the other leg of the resistor to the right \n side Tie-Point row of your choice. In this example we have used row 5, \n column J\nOn the Breadboard, connect the cathode leg (the shortest leg) of the \n LED to the same Tie-Point row that you connected the resistor from GND \n to. In this example we used row 5, column F\nOn the Breadboard, connect the anode leg (the longest leg) of the \n LED to the same Tie-Point row that you connected the jumper from \n the GPIO pin to. In this example we used row \n 5, column E\n\nYour circuit should now be complete, and your connections should look \n pretty similar to the illustration above.\nNow it is time to boot up the Raspberry Pi, and write the Node.js script to \n interact with it.\n\n\n\n\n\n\n\nRaspberry Pi and Node.js Blinking LED Script\nNow that we have everything set up, we can write a script to turn the LED on and off.\nStart by making a directory where we can keep our Node.js scripts:\n\n pi@w3demopi:~ $ mkdir nodetest\n\nGo to our new directory:\n\n pi@w3demopi:~ $ cd nodetest\n\nNow we will create a new file called \"blink.js\" using the Nano Editor:\n\n pi@w3demopi:~ $ nano blink.js\n\nThe file is now open and can be edited with the built in Nano Editor.\nWrite, or paste the following code:\n\nblink.js\n\n var Gpio = require('onoff').Gpio; //include onoff to interact with the GPIOvar LED = new Gpio(4, 'out'); \n //use GPIO pin 4, and specify that it is outputvar \n blinkInterval = setInterval(blinkLED, 250); //run the blinkLED function every \n 250msfunction blinkLED() { //function to start blinking  if (LED.readSync() === \n 0) { //check the pin state, if the state is 0 (or off)    LED.writeSync(1); \n //set pin state to 1 (turn LED on)  } else {    LED.writeSync(0); \n //set pin state to 0 (turn LED off)  }}function endBlink() \n { //function to stop blinking  clearInterval(blinkInterval); // Stop blink intervals  \n LED.writeSync(0); // Turn LED off  LED.unexport(); // Unexport GPIO \n to free resources}setTimeout(endBlink, 5000); //stop blinking \n after 5 seconds\n\nPress \"Ctrl+x\" to save the code. Confirm with \"y\", and confirm the name with \"Enter\".\nRun the code:\n\n pi@w3demopi:~ $ node blink.js\n\nNow the LED should blink for 5 seconds (10 times) before turning off again!\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var Gpio = require('onoff').Gpio; //include onoff to interact with the GPIOvar LED = new Gpio(4, 'out'); \n //use GPIO pin 4, and specify that it is outputvar \n blinkInterval = setInterval(blinkLED, 250); //run the blinkLED function every \n 250msfunction blinkLED() { //function to start blinking  if (LED.readSync() === \n 0) { //check the pin state, if the state is 0 (or off)    LED.writeSync(1); \n //set pin state to 1 (turn LED on)  } else {    LED.writeSync(0); \n //set pin state to 0 (turn LED off)  }}function endBlink() \n { //function to stop blinking  clearInterval(blinkInterval); // Stop blink intervals  \n LED.writeSync(0); // Turn LED off  LED.unexport(); // Unexport GPIO \n to free resources}setTimeout(endBlink, 5000); //stop blinking \n after 5 seconds" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_raspberrypi_led_pushbutton.asp", + "content": "Node.js Raspberry Pi GPIO - LED and Pushbutton\n\n❮ Previous\nNext ❯\n\n\nUsing both Input and Output\nIn the previous chapter we learned how to use a Raspberry Pi and its GPIO to \nmake a LED blink.\nFor that we used a GPIO pin as \"Output\".\nIn this chapter we will use another GPIO pin as \"Input\".\nInstead of blinking for 5 seconds, we want the LED to light up when you push \na button connected to the breadboard.\n\nWhat do we need?\nIn this chapter we will create a simple example where \nwe control a LED light with a Push Button.\nFor this you need:\n\nA Raspberry Pi with Raspian, internet, SSH, with Node.js installed\nThe \n onoff module for Node.js\n1 x Breadboard\n1 x 68 Ohm resistor\n1 x 1k Ohm resistor\n1 x Through Hole LED\n1 x Push Button\n4 x Female to male jumper wires\n1 x Male to Male jumper wires\n\nClick the links in the list above for descriptions of the different \ncomponents.\n\nNote: The resistor you need can be different from what we use depending on the type of LED you use. Most small LEDs only need a small resistor, around 200-500 ohms. It is generally not critical what exact value you use, but the smaller the value of the resistor, the brighter the LED will\nshine.\n\nIn this chapter we will build on the circuit we built in last chapter, so you \nwill recognize some of the parts in the list above.\n\nBuilding the Circuit\nNow it is time to build the circuit on our Breadboard. We will use the circuit we created in the last chapter as a starting point.\nIf you are new to electronics, we recommend you turn off the power for \nthe Raspberry Pi. And use an anti-static mat or a grounding strap to avoid \ndamaging it.\nShut down the Raspberry Pi properly with the command:\n\n pi@w3demopi:~ $ sudo shutdown -h now\n\nAfter the LEDs stop blinking on the Raspberry Pi, then pull out the power \nplug from the Raspberry Pi (or turn of the power strip it is connected to).\nJust pulling the plug without shutting down properly may cause corruption of the memory card.\n\nLook at the above illustration of the circuit.\n\nStarting with the circuit we created in the last chapter:\n On the Raspberry Pi, connect the female leg of a jumper wire to a \n 5V \n power pin. In our example we used Physical Pin 2 (5V, \n row 1, right column)\nOn the Breadboard, connect the male leg of the jumper wire connected to \n the 5V power, to the \n Power Bus on the right side. That entire column \n of your breadboard is connected, so it doesn't matter which row. In our \n example we attached it to row 1\nOn the Breadboard, connect the push button so that it fits across the \n Trench. In our example it connects to rows 13 and 15, columns E and F\nOn the Breadboard, connect one leg of the 1k ohm resistor to the Ground Bus \n column on the right side, and the other leg to the right side Tie-Point row \n where it connects to one of the right side legs of the push button. In our example we attached \n one side to Tie-Point row 13, column J, and the other side to the closest Ground Bus hole\nOn the Breadboard, connect a male-to-male jumper wire from the right \n Power Bus, to the right Tie-Point row that \n connects to the other leg of the \n push button. In our example we attached \n one side to Tie-Point row 15, column J, and the other side to the closest Power Bus hole\nOn the Raspberry Pi, connect the female leg of a jumper wire to a \n GPIO pin. In our example we used Physical Pin \n 11 (GPIO 17, row 6, left \n column)\nOn the Breadboard, connect the male leg of the jumper wire to left \n Tie-Point row the Push Button leg that is directly across the \n Ground connection leg.  In our example we \n attached it to row 13, column A\n\nYour circuit should now be complete, and your connections should look \n pretty similar to the illustration above.\nNow it is time to boot up the Raspberry Pi, and write the Node.js script to \n interact with it.\n\n\n\n\n\n\n\nRaspberry Pi and Node.js LED and Button Script\nGo to the \"nodetest\" directory, and create a new file called \"buttonled.js\":\n\n pi@w3demopi:~ $ nano buttonled.js\n\nThe file is now open and can be edited with the built in Nano Editor.\nWrite, or paste the following:\n\nbuttonled.js\n\n var\n Gpio = require('onoff').Gpio; //include onoff to interact with the GPIOvar \n LED = new Gpio(4, 'out'); //use GPIO pin 4 as outputvar pushButton = new \n Gpio(17, 'in', 'both'); //use GPIO pin 17 as input, and 'both' button presses, \n and releases should be handledpushButton.watch(function (err, value) { \n //Watch for hardware interrupts on pushButton GPIO, specify callback function  \n if (err) { //if an error    console.error('There was an \n error', err); //output error message to console  return;  }  \n LED.writeSync(value); //turn LED on or off depending on the button state (0 or \n 1)});\n function unexportOnClose() { //function to run when exiting program  \n LED.writeSync(0); // Turn LED off  LED.unexport(); // Unexport LED \n GPIO to free resources  pushButton.unexport(); // Unexport Button \n GPIO to free resources};process.on('SIGINT', unexportOnClose); //function to \n run when user closes using ctrl+c\n\nPress \"Ctrl+x\" to save the code. Confirm with \"y\", and confirm the name with \"Enter\".\nRun the code:\n\n pi@w3demopi:~ $ node buttonled.js\n\nNow the LED should turn on when you press the button, and turn off when you \nrelease it.\nEnd the program with Ctrl+c.\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var\n Gpio = require('onoff').Gpio; //include onoff to interact with the GPIOvar \n LED = new Gpio(4, 'out'); //use GPIO pin 4 as outputvar pushButton = new \n Gpio(17, 'in', 'both'); //use GPIO pin 17 as input, and 'both' button presses, \n and releases should be handledpushButton.watch(function (err, value) { \n //Watch for hardware interrupts on pushButton GPIO, specify callback function  \n if (err) { //if an error    console.error('There was an \n error', err); //output error message to console  return;  }  \n LED.writeSync(value); //turn LED on or off depending on the button state (0 or \n 1)});\n function unexportOnClose() { //function to run when exiting program  \n LED.writeSync(0); // Turn LED off  LED.unexport(); // Unexport LED \n GPIO to free resources  pushButton.unexport(); // Unexport Button \n GPIO to free resources};process.on('SIGINT', unexportOnClose); //function to \n run when user closes using ctrl+c" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_raspberrypi_flowing_leds.asp", + "content": "Node.js Raspberry Pi GPIO - Flowing LEDs\n\n❮ Previous\nNext ❯\n\n\nUsing Array With Output to Create Flowing LEDs\nIn this chapter we will use several GPIO pins to create a \"flowing\" effect by \nturning them on and off in sequence.\n\n\nWhat do we need?\nFor this you need:\n\nA Raspberry Pi with Raspian, internet, SSH, with Node.js installed\nThe \n onoff module for Node.js\n1 x Breadboard\n8 x 220 Ohm resistor\n8 x Through Hole LED\n9 x Female to male jumper wires\n\n\nNote: The resistor you need can be different from what we use depending on the type of LEDs you use. Most small LEDs only need a small resistor, around 200-500 ohms. It is generally not critical what exact value you use, but the smaller the value of the resistor, the brighter the LED will\nshine.\n\nClick the links in the list above for descriptions of the different \ncomponents.\n\nBuilding the Circuit\nNow it is time to build the circuit on our Breadboard.\nIf you are new to electronics, we recommend you turn off the power for \nthe Raspberry Pi. And use an anti-static mat or a grounding strap to avoid \ndamaging it.\nShut down the Raspberry Pi properly with the command:\n\n pi@w3demopi:~ $ sudo shutdown -h now\n\nAfter the LEDs stop blinking on the Raspberry Pi, then pull out the power \nplug from the Raspberry Pi (or turn of the power strip it is connected to).\nJust pulling the plug without shutting down properly may cause corruption of the memory card.\n\nLook at the above illustration of the circuit.\n\nOn the Raspberry Pi, connect the female leg of a jumper wire to a GND pin. In our example we used Physical Pin 6 (GND, \n row 3, right column)\nOn the Breadboard, connect the male leg of the jumper wire connected to \n the GND power, to the Ground Bus on the right side. That entire column \n of your breadboard is connected, so it doesn't matter which row. In our example we attached it to row 1\nFor each LED: Connect the LED so that it connects to 2 Tie-Point rows. In our example \n we connected:\nLED1 to rows 5 (cathode) & 6 (anode) column J\nLED2 to rows 8 (cathode) & 9 (anode) column J\nLED3 to rows 11 (cathode) & 12 (anode) column J\nLED4 to rows 14 (cathode) & 15 (anode) column J\nLED5 to rows 17 (cathode) & 18 (anode) column J\nLED6 to rows 20 (cathode) & 21 (anode) column J\nLED7 to rows 23 (cathode) & 24 (anode) column J\nLED8 to rows 26 (cathode) & 27 (anode) column J\n\n\nFor each LED: Connect one of the legs of a 220 ohm resistor from the the Ground Bus \n column on the right side, and the other leg to the right side Tie-Point row \n where it connects to the cathode leg of the LED. In our example we \n connected:\nLED1 to row 5 column I\nLED2 to row 8 column I\nLED3 to row 11 column I\nLED4 to row 14 column I\nLED5 to row 17 column I\nLED6 to row 20 column I\nLED7 to row 23 column I\nLED8 to row 26 column I\n\n\nFor each LED: Connect the female leg of a jumper wire to a\n GPIO pin on the Raspberry Pi, and the male leg \n of the jumper wire to the right side Tie-Point row \n where it connects to the anode leg of the LED. In our example we connected:\nLED1 from Physical Pin \n 7 (GPIO 4, row 4, left \n column) to Tie-point row 6 column F\nLED2 from Physical Pin \n 11 (GPIO 17, row 6, left \n column) to Tie-point row 9 column F\nLED3 from Physical Pin \n 13 (GPIO 27, row 7, left \n column) to Tie-point row 12 column F\nLED4 from Physical Pin \n 15 (GPIO 22, row 8, left \n column) to Tie-point row 15 column F\nLED5 from Physical Pin \n 12 (GPIO 18, row 6, right \n column) to Tie-point row 18 column F\nLED6 from Physical Pin \n 16 (GPIO 23, row 8, right column) to \n Tie-point row 21 column F\nLED7 from Physical Pin \n 18 (GPIO 24, row 9, right column) to \n Tie-point row 24 column F\nLED8 from Physical Pin \n 22 (GPIO 25, row 11, right column) to \n Tie-point row 27 column F\n\n\n\nYour circuit should now be complete, and your connections should look \n pretty similar to the illustration above.\nNow it is time to boot up the Raspberry Pi, and write the Node.js script to \n interact with it.\n\n\n\n\n\n\n\nRaspberry Pi and Node.js Flowing LEDs Script\nGo to the \"nodetest\" directory, and create a new file called \"flowingleds.js\":\n\n pi@w3demopi:~ $ nano \n flowingleds.js\n\nThe file is now open and can be edited with the built in Nano Editor.\nWrite, or paste the following:\n\nflowingleds.js\n\n var Gpio = require('onoff').Gpio; //include onoff to interact with the GPIO\n var LED04 = new Gpio(4, 'out'), //use declare variables for all the GPIO \n output pins  LED17 = new Gpio(17, 'out'),  LED27 = new Gpio(27, \n 'out'),  LED22 = new Gpio(22, 'out'),  LED18 = new Gpio(18, \n 'out'),  LED23 = new Gpio(23, 'out'),  LED24 = new Gpio(24, \n 'out'),  LED25 = new Gpio(25, 'out');//Put all the LED \n variables in an arrayvar leds = [LED04, \n LED17, LED27, LED22, LED18, LED23, LED24, LED25];var indexCount = 0; //a \n counterdir = \"up\"; //variable for flowing directionvar \n flowInterval = setInterval(flowingLeds, 100); //run the flowingLeds function \n every 100msfunction flowingLeds() { //function for flowing Leds  \n leds.forEach(function(currentValue) { //for each item in array    \n currentValue.writeSync(0); //turn off LED  });  if (indexCount \n == 0) dir = \"up\"; //set flow direction to \"up\" if the count reaches zero  \n if (indexCount >= leds.length) dir = \"down\"; //set flow direction to \"down\" if \n the count reaches 7  if (dir == \"down\") indexCount--; //count \n downwards if direction is down  leds[indexCount].writeSync(1); \n //turn on LED that where array index matches count  if (dir == \n \"up\") indexCount++ //count upwards if direction is up};function unexportOnClose() { \n //function to run when exiting program  clearInterval(flowInterval); \n //stop flow interwal  leds.forEach(function(currentValue) { //for \n each LED    currentValue.writeSync(0); //turn off LED    \n currentValue.unexport(); //unexport GPIO  });};process.on('SIGINT', unexportOnClose); //function to \n run when user closes using ctrl+cc\n\nPress \"Ctrl+x\" to save the code. Confirm with \"y\", and confirm the name with \"Enter\".\nRun the code:\n\n pi@w3demopi:~ $ node flowingleds.js\n\nNow the LEDs should turn on and off in sequence, creating a flowing effect.\nEnd the program with Ctrl+c.\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var Gpio = require('onoff').Gpio; //include onoff to interact with the GPIO\n var LED04 = new Gpio(4, 'out'), //use declare variables for all the GPIO \n output pins  LED17 = new Gpio(17, 'out'),  LED27 = new Gpio(27, \n 'out'),  LED22 = new Gpio(22, 'out'),  LED18 = new Gpio(18, \n 'out'),  LED23 = new Gpio(23, 'out'),  LED24 = new Gpio(24, \n 'out'),  LED25 = new Gpio(25, 'out');//Put all the LED \n variables in an arrayvar leds = [LED04, \n LED17, LED27, LED22, LED18, LED23, LED24, LED25];var indexCount = 0; //a \n counterdir = \"up\"; //variable for flowing directionvar \n flowInterval = setInterval(flowingLeds, 100); //run the flowingLeds function \n every 100msfunction flowingLeds() { //function for flowing Leds  \n leds.forEach(function(currentValue) { //for each item in array    \n currentValue.writeSync(0); //turn off LED  });  if (indexCount \n == 0) dir = \"up\"; //set flow direction to \"up\" if the count reaches zero  \n if (indexCount >= leds.length) dir = \"down\"; //set flow direction to \"down\" if \n the count reaches 7  if (dir == \"down\") indexCount--; //count \n downwards if direction is down  leds[indexCount].writeSync(1); \n //turn on LED that where array index matches count  if (dir == \n \"up\") indexCount++ //count upwards if direction is up};function unexportOnClose() { \n //function to run when exiting program  clearInterval(flowInterval); \n //stop flow interwal  leds.forEach(function(currentValue) { //for \n each LED    currentValue.writeSync(0); //turn off LED    \n currentValue.unexport(); //unexport GPIO  });};process.on('SIGINT', unexportOnClose); //function to \n run when user closes using ctrl+cc" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_raspberrypi_webserver_websocket.asp", + "content": "Node.js and Raspberry Pi - Webserver with WebSocket\n\n❮ Previous\nNext ❯\n\n\nWhat is WebSocket?\nWebSocket enables bidirectional communication in real time over the web.\nWebSocket can be run together with a normal HTTP server. You can click a button in a web browser, and enable a GPIO on your Raspberry Pi which turns on a light in your house. All in real time, and with communication going both ways!\nIn this chapter, we will set up a web server with WebSocket. Then create a browser UI to interact with our earlier example of turning a LED on and off with a button.\n\n\nWhat Do I Need?\nFor this tutorial you need a Raspberry Pi. In our examples we use a a Raspberry Pi 3, \nbut this tutorial should work for most versions.\nFor this you need:\n\nA Raspberry Pi with Raspian, internet, SSH, with Node.js installed\nThe \n onoff module for Node.js\nThe \n socket.io module for Node.js\n1 x Breadboard\n1 x \n 68 Ohm resistor\n1 x \n 1k Ohm resistor\n1 x \n Through Hole LED\n1 x \n Push Button\n4 x \n Female to male jumper wires\n1 x \n Male to Male jumper wires\n\nClick the links in the list above for descriptions of the different \ncomponents.\n\nNote: The resistor you need can be different from what we use depending on the type of LED you use. Most small LEDs only need a small resistor, around 200-500 ohms. It is generally not critical what exact value you use, but the smaller the value of the resistor, the brighter the LED will\nshine.\n\nCompared to our earlier example, the only new thing we need is to set up a \nweb server, and install the socket.io module.\n\nWebserver for Raspberry Pi and Node.js\nFollowing the earlier chapters in this Node.js tutorial, lets set up a web \nserver that can serve HTML files.\nIn our \"nodetest\" directory create a new directory we can use for static html files:\n\n pi@w3demopi:~/nodetest $ \n mkdir public\nNow lets set up a webserver. Create a Node.js file that opens the requested \nfile and returns the content to the client. If anything goes wrong, throw a 404 \nerror.\n\n pi@w3demopi:~/nodetest $ \n nano webserver.js\n\nwebserver.js:\n\n var http = require('http').createServer(handler); //require http server, and \n create server with function handler()var fs = require('fs'); //require filesystem modulehttp.listen(8080); //listen to port 8080\n function handler (req, res) { //create server  fs.readFile(__dirname + '/public/index.html', function(err, data) { //read \n file index.html in public folder    if (err) \n {      res.writeHead(404, \n {'Content-Type': 'text/html'}); //display 404 on error      \n return res.end(\"404 Not Found\");    }     res.writeHead(200, {'Content-Type': 'text/html'}); //write HTML    res.write(data); //write data from index.html    \n return res.end();  });}\n\nGo to the folder \"public\":\n\n pi@w3demopi:~/nodetest $ \n cd public\n\nAnd create a HTML file, index.html:\n\n pi@w3demopi:~/nodetest/public $ \n nano index.html\n\nindex.html:\n\n

Control LED light

LED\n\nThis file will not have any functionality yet. For now it is just a \nplaceholder. Lets see if the webserver is working:\n\npi@w3demopi:~/nodetest/public $ cd ..\n\npi@w3demopi:~/nodetest $ node webserver.js\nOpen the website in a browser using http://[RaspberryPi_IP]:8080/:\nThe webserver should now be up and running, and we can move on to the \nWebSocket part.\n\nInstall socket.io for Node.js\nWith the webserver set up, update your Raspberry Pi system packages to their latest versions.\nUpdate your system package list:\n\n pi@w3demopi:~ $ sudo apt-get update\n\nUpgrade all your installed packages to their latest version:\n\n pi@w3demopi:~ $ sudo apt-get dist-upgrade\n\n\nDoing this regularly will keep your Raspberry Pi installation up to date.\n\nTo download and install newest version of socket.io, use the following command:\n\n pi@w3demopi:~ $ \n npm install socket.io --save\n\n\n\n\n\n\nAdding WebSocket to our Webserver\nNow we can use WebSocket in our application. Lets update our index.html \nfile:\n\nindex.html:\n\n

Control LED \n light

\n \n\nAnd our webserver.js file:\n\nwebserver.js:\n\n var http = require('http').createServer(handler); //require http server, and \n create server with function handler()var fs = require('fs'); //require filesystem modulevar io \n = require('socket.io')(http) //require socket.io module and pass the http \n object (server)http.listen(8080); //listen to port 8080\n function handler (req, res) { //create server  fs.readFile(__dirname + '/public/index.html', function(err, data) { //read \n file index.html in public folder    if (err) \n {      res.writeHead(404, \n {'Content-Type': 'text/html'}); //display 404 on error      \n return res.end(\"404 Not Found\");    }     res.writeHead(200, {'Content-Type': 'text/html'}); //write HTML    res.write(data); //write data from index.html    \n return res.end();  });}\n io.sockets.on('connection', function (socket) {// WebSocket Connection  \n var lightvalue = 0; //static variable for current status  socket.on('light', \n function(data) { //get light switch status from client    \n lightvalue = data;    if (lightvalue) {      \n console.log(lightvalue); //turn LED on or off, for now we will just show it \n in console.log    }  });});\n\nLets test the server:\n\n pi@w3demopi:~ $ \n node webserver.js\n\nOpen the website in a browser using http://[RaspberryPi_IP]:8080/:\nNow the server should output all the changes to the checkbox to the console \non the Raspberry Pi.\nThe client is sending the changes to the server, and the server is \nresponding.\nLets add the push button \ncontrolled LED from a previous chapter.\n\nAdding Hardware, and sending a response to the Client\nLets update our webserver.js file again. We will use a lot of the code from \nthe Pushbutton controlled LED chapter.\n\nwebserver.js:\n\n var http = require('http').createServer(handler); //require http server, and \n create server with function handler()var fs = require('fs'); //require filesystem modulevar io \n = require('socket.io')(http) //require socket.io module and pass the http \n object (server)var Gpio = require('onoff').Gpio; //include onoff to \n interact with the GPIOvar LED = new Gpio(4, 'out'); //use GPIO pin 4 as \n outputvar pushButton = new Gpio(17, 'in', 'both'); //use GPIO pin 17 as \n input, and 'both' button presses, and releases should be handled\n http.listen(8080); //listen to port 8080function handler (req, res) \n { //create server  fs.readFile(__dirname \n + '/public/index.html', function(err, data) { //read file index.html in \n public folder    if (err) {      res.writeHead(404, {'Content-Type': 'text/html'}); //display 404 on error      \n return res.end(\"404 Not Found\");    }     res.writeHead(200, {'Content-Type': 'text/html'}); //write HTML    res.write(data); //write data from index.html    \n return res.end();  });}\n io.sockets.on('connection', function (socket) {// WebSocket Connection  \n var lightvalue = 0; //static variable for current status  \n pushButton.watch(function (err, value) { //Watch for hardware interrupts on \n pushButton    if (err) { //if an error      \n console.error('There was an error', err); //output error message to console      \n return;    }    lightvalue = value;    \n socket.emit('light', lightvalue); //send button status to client  \n });  socket.on('light', function(data) { //get light switch status \n from client    lightvalue = data;    \n if (lightvalue != LED.readSync()) { //only change LED if status has changed      \n LED.writeSync(lightvalue); //turn LED on or off    }  \n });});process.on('SIGINT', function () { //on ctrl+c  \n LED.writeSync(0); // Turn LED off  LED.unexport(); // Unexport LED \n GPIO to free resources  pushButton.unexport(); // Unexport Button \n GPIO to free resources  process.exit(); //exit completely});\n\nLets test the server:\n\n pi@w3demopi:~ $ node webserver.js\n\nOpen the website in a browser using http://[RaspberryPi_IP]:8080/:\nNow the server should output all the changes to the checkbox to the console \non the Raspberry Pi.\nThe client is sending the changes to the server, and the server is \nresponding.\nEnd the program with Ctrl+c.\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var http = require('http').createServer(handler); //require http server, and \n create server with function handler()var fs = require('fs'); //require filesystem modulehttp.listen(8080); //listen to port 8080\n function handler (req, res) { //create server  fs.readFile(__dirname + '/public/index.html', function(err, data) { //read \n file index.html in public folder    if (err) \n {      res.writeHead(404, \n {'Content-Type': 'text/html'}); //display 404 on error      \n return res.end(\"404 Not Found\");    }     res.writeHead(200, {'Content-Type': 'text/html'}); //write HTML    res.write(data); //write data from index.html    \n return res.end();  });}" + }, + { + "language": "javascript", + "code": "

Control LED light

LED" + }, + { + "language": "javascript", + "code": "

Control LED \n light

\n " + }, + { + "language": "javascript", + "code": "var http = require('http').createServer(handler); //require http server, and \n create server with function handler()var fs = require('fs'); //require filesystem modulevar io \n = require('socket.io')(http) //require socket.io module and pass the http \n object (server)http.listen(8080); //listen to port 8080\n function handler (req, res) { //create server  fs.readFile(__dirname + '/public/index.html', function(err, data) { //read \n file index.html in public folder    if (err) \n {      res.writeHead(404, \n {'Content-Type': 'text/html'}); //display 404 on error      \n return res.end(\"404 Not Found\");    }     res.writeHead(200, {'Content-Type': 'text/html'}); //write HTML    res.write(data); //write data from index.html    \n return res.end();  });}\n io.sockets.on('connection', function (socket) {// WebSocket Connection  \n var lightvalue = 0; //static variable for current status  socket.on('light', \n function(data) { //get light switch status from client    \n lightvalue = data;    if (lightvalue) {      \n console.log(lightvalue); //turn LED on or off, for now we will just show it \n in console.log    }  });});" + }, + { + "language": "javascript", + "code": "var http = require('http').createServer(handler); //require http server, and \n create server with function handler()var fs = require('fs'); //require filesystem modulevar io \n = require('socket.io')(http) //require socket.io module and pass the http \n object (server)var Gpio = require('onoff').Gpio; //include onoff to \n interact with the GPIOvar LED = new Gpio(4, 'out'); //use GPIO pin 4 as \n outputvar pushButton = new Gpio(17, 'in', 'both'); //use GPIO pin 17 as \n input, and 'both' button presses, and releases should be handled\n http.listen(8080); //listen to port 8080function handler (req, res) \n { //create server  fs.readFile(__dirname \n + '/public/index.html', function(err, data) { //read file index.html in \n public folder    if (err) {      res.writeHead(404, {'Content-Type': 'text/html'}); //display 404 on error      \n return res.end(\"404 Not Found\");    }     res.writeHead(200, {'Content-Type': 'text/html'}); //write HTML    res.write(data); //write data from index.html    \n return res.end();  });}\n io.sockets.on('connection', function (socket) {// WebSocket Connection  \n var lightvalue = 0; //static variable for current status  \n pushButton.watch(function (err, value) { //Watch for hardware interrupts on \n pushButton    if (err) { //if an error      \n console.error('There was an error', err); //output error message to console      \n return;    }    lightvalue = value;    \n socket.emit('light', lightvalue); //send button status to client  \n });  socket.on('light', function(data) { //get light switch status \n from client    lightvalue = data;    \n if (lightvalue != LED.readSync()) { //only change LED if status has changed      \n LED.writeSync(lightvalue); //turn LED on or off    }  \n });});process.on('SIGINT', function () { //on ctrl+c  \n LED.writeSync(0); // Turn LED off  LED.unexport(); // Unexport LED \n GPIO to free resources  pushButton.unexport(); // Unexport Button \n GPIO to free resources  process.exit(); //exit completely});" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_raspberrypi_rgb_led_websocket.asp", + "content": "Node.js Raspberry Pi RGB LED with WebSocket\n\n❮ Previous\nNext ❯\n\n\nUsing Pulse-Width Modulation\nIn the previous chapters we have learned how to use WebSocket, and how to \nuse GPIO to turn LEDs on and off.\nIn this we will use chapter we use a RGB LED, with PWM (Pulse-width \nmodulation) to display different colors based on user input via WebSocket.\n\nAn RGB LED is a LED with 3 different colors. It has a RED, GREEN and \nBLUE LED (RGB LED).\nAnd using PWM, we can set the individual strength of the 3 LEDs. This will allow us to \nmix them, to set a color.\n\nWhat do we need?\nIn this chapter we will create an example where \nwe control an RGB LED with a web page via WebSocket.\nFor this you need:\n\nA Raspberry Pi with Raspian, internet, SSH, with Node.js installed\nThe \n pigpio module for Node.js\nThe \n socket.io module for Node.js\n1 x Breadboard\n3 x\n 220 \n Ohm resistor\n1 x RGB LED (common anode or common cathode)\n4 x Female to male jumper wires\n\nClick the links in the list above for descriptions of the different \ncomponents.\n\nNote: The resistor you need can be different from what we use depending on the type of LED you use. Most small LEDs only need a small resistor, around 200-500 ohms. It is generally not critical what exact value you use, but the smaller the value of the resistor, the brighter the LED will\nshine.\n\n\nInstall the pigpio Module\nEarlier, we have used the \"onoff\" module, which works great for just turning \non and off. Now we want to set the set the strength of the LEDs, so we need a \nGPIO Module with a bit more functionality.\nWe will use the \"pigpio\" Node.js module, as this allows for PWM.\nWith PWM we \ncan set the strength of a LED from 0 to 255.\nThe \"pigpio\" Node.js module is based on the pigpio C library.\nIf you are using the \"Lite\" version of Raspbian, this is most likely not \nincluded and must be manually installed.\nUpdate your system package list:\n\n pi@w3demopi:~ $ sudo apt-get update\nInstall the pigpio C library:\n\n pi@w3demopi:~ $ sudo apt-get install pigpio\nNow we can install the \"pigpio\" Node.js module using npm:\n\n pi@w3demopi:~ $ npm install pigpio\nNow the \"pigpio\" module should be installed and we can use it to \ninteract with the GPIO of the Raspberry Pi.\n\nNote: Since the \"pigpio\" module uses the pigpio C library, \n it requires root/sudo privileges to access hardware peripherals (like the \n GPIO).\n\n\nBuilding the Circuit\nNow it is time to build the circuit on our Breadboard.\nIf you are new to electronics, we recommend you turn off the power for \nthe Raspberry Pi. And use an anti-static mat or a grounding strap to avoid \ndamaging it.\nShut down the Raspberry Pi properly with the command:\n\n pi@w3demopi:~ $ sudo shutdown -h now\n\nAfter the LEDs stop blinking on the Raspberry Pi, then pull out the power \nplug from the Raspberry Pi (or turn of the power strip it is connected to).\nJust pulling the plug without shutting down properly may cause corruption of the memory card.\n\nIn building this Circuit it is important to know if you have a common \n anode, or common cathode, RGB LED:\nYou can check with your provider, or test it yourself:\nConnect cables to GND and 3.3V pin. Connect GND to the longest leg of the \n RGB LED and the 3.3 V to any other leg. If the it lights up, your RGB LED has \n a common cathode. If not, it has a common anode.\nBuilding the Circuit - Common Cathode\n\n\nLook at the above illustration of the circuit.\n\nOn the Breadboard, connect the RGB LED to the right ground bus column, \n and make sure that each leg connects to a different row. The longest leg is \n the common cathode leg. In this example we have connected the LED to rows \n 1-4, with the common cathode leg connected to row 2 column I. The RED leg is \n connected to row 1 column J, the GREEN leg is connected to row 3 column J, \n and the BLUE leg is connected to row 4 column J\nOn the Raspberry Pi, connect the female leg of the first jumper wire to \n Ground. You can use any GND pin. In this example we used Physical Pin 9 (GND, \n row 5, left column)\nOn the Breadboard, connect the male leg of the first jumper wire to \n the same row of the right ground bus column that you connected the common \n cathode to. In this example we connected it to row 2 column F\nOn the Raspberry Pi, connect the female leg of the second jumper cable \n to a GPIO pin. We will use this for the RED \n leg, In this example we used Physical Pin \n 7 (GPIO 4, row 4, left \n column)\nOn the Breadboard, connect the male leg of the second jumper wire to the \n left ground bus, same row as the RED leg of the LED is connected. In this example we connected it to row \n 1, \n column A\nOn the Breadboard, connect a resistor between the left and right ground \n bus columns for the row with the RED leg of the LED. In this example we have attached \n it to row 1, column E and F\nOn the Raspberry Pi, connect the female leg of the third jumper cable \n to a GPIO pin. We will use this for the GREEN \n leg, In this example we used Physical Pin \n 11 (GPIO 17, row 6, left \n column)\nOn the Breadboard, connect the male leg of the third jumper wire to the \n left ground bus, same row as the GREEN leg of the LED is connected. In this example we connected it to row \n 3, \n column A\nOn the Breadboard, connect a resistor between the left and right ground \n bus columns for the row with the GREEN leg of the LED. In this example we have attached \n it to row 3, column E and F\nOn the Raspberry Pi, connect the female leg of the forth jumper cable \n to a GPIO pin. We will use this for the BLUE \n leg, In this example we used Physical Pin \n 13 (GPIO 27, row 7, left \n column)\nOn the Breadboard, connect the male leg of the forth jumper wire to the \n left ground bus, same row as the BLUE leg of the LED is connected. In this example we connected it to row \n 4, \n column A\nOn the Breadboard, connect a resistor between the left and right ground \n bus columns for the row with the BLUE leg of the LED. In this example we have attached \n it to row 4, column E and F\n\nYour circuit should now be complete, and your connections should look \n pretty similar to the illustration above.\nNow it is time to boot up the Raspberry Pi, and write the Node.js script to \n interact with it.\n\nBuilding the Circuit - Common Anode\n\n\nLook at the above illustration of the circuit.\n\nOn the Breadboard, connect the RGB LED to the right ground bus column, \n and make sure that each leg connects to a different row. The longest leg is \n the common anode leg. In this example we have connected the LED to rows \n 1-4, with the common cathode leg connected to row 2 column I. The RED leg is \n connected to row 1 column J, the GREEN leg is connected to row 3 column J, \n and the BLUE leg is connected to row 4 column J\nOn the Raspberry Pi, connect the female leg of the first jumper cable \n to a GPIO pin. We will use this for the RED \n leg, In this example we used Physical Pin \n 7 (GPIO 4, row 4, left \n column)\nOn the Breadboard, connect the male leg of the first jumper wire to the \n left ground bus, same row as the RED leg of the LED is connected. In this example we connected it to row \n 1, \n column A\nOn the Breadboard, connect a resistor between the left and right ground \n bus columns for the row with the RED leg of the LED. In this example we have attached \n it to row 1, column E and F\nOn the Raspberry Pi, connect the female leg of the second jumper cable \n to a GPIO pin. We will use this for the GREEN \n leg, In this example we used Physical Pin \n 11 (GPIO 17, row 6, left \n column)\nOn the Breadboard, connect the male leg of the second jumper wire to the \n left ground bus, same row as the GREEN leg of the LED is connected. In this example we connected it to row \n 3, \n column A\nOn the Breadboard, connect a resistor between the left and right ground \n bus columns for the row with the GREEN leg of the LED. In this example we have attached \n it to row 3, column E and F\nOn the Raspberry Pi, connect the female leg of the third jumper cable \n to a GPIO pin. We will use this for the BLUE \n leg, In this example we used Physical Pin \n 13 (GPIO 27, row 7, left \n column)\nOn the Breadboard, connect the male leg of the third jumper wire to the \n left ground bus, same row as the BLUE leg of the LED is connected. In this example we connected it to row \n 4, \n column A\nOn the Breadboard, connect a resistor between the left and right ground \n bus columns for the row with the BLUE leg of the LED. In this example we have attached \n it to row 4, column E and F\nOn the Raspberry Pi, connect the female leg of the forth jumper wire to \n 3.3V. In this example we used Physical Pin 1 (3.3V, \n row 1, left column)\nOn the Breadboard, connect the male leg of the forth jumper wire to \n the same row of the right ground bus column that you connected the common \n anode to. In this example we connected it to row 2 column F\n\nYour circuit should now be complete, and your connections should look \n pretty similar to the illustration above.\nNow it is time to boot up the Raspberry Pi, and write the Node.js script to \n interact with it.\n\n\n\n\n\n\n\nRaspberry Pi and Node.js RGB LED and WebSocket Script\nGo to the \"nodetest\" directory, and create a new file called \"rgbws.js\":\n\n pi@w3demopi:~ $ nano rgbws.js\n\nThe file is now open and can be edited with the built in Nano Editor.\nUsing a Common Cathode RGB LED\n\nWrite, or paste the following:\n\nrgbws.js\n\n var http = require('http').createServer(handler); //require http server, and \n create server with function handler()var fs = require('fs'); //require \n filesystem modulevar io = require('socket.io')(http) //require socket.io \n module and pass the http object (server)var Gpio = require('pigpio').Gpio, \n //include pigpio to interact with the GPIOledRed = new Gpio(4, {mode: \n Gpio.OUTPUT}), //use GPIO pin 4 as output for REDledGreen = new Gpio(17, \n {mode: Gpio.OUTPUT}), //use GPIO pin 17 as output for GREENledBlue = new \n Gpio(27, {mode: Gpio.OUTPUT}), //use GPIO pin 27 as output for BLUEredRGB \n = 0, //set starting value of RED variable to off (0 for common cathode)\n greenRGB = 0, //set starting value of GREEN variable to off (0 for common \n cathode)blueRGB = 0; //set starting value of BLUE variable to off (0 for \n common cathode)//RESET RGB LEDledRed.digitalWrite(0); // Turn RED \n LED offledGreen.digitalWrite(0); // Turn GREEN LED off\n ledBlue.digitalWrite(0); // Turn BLUE LED offhttp.listen(8080); \n //listen to port 8080function handler (req, res) { //what to do on \n requests to port 8080  fs.readFile(__dirname + '/public/rgb.html', \n function(err, data) { //read file rgb.html in public folder    \n if (err) {      res.writeHead(404, \n {'Content-Type': 'text/html'}); //display 404 on error      \n return res.end(\"404 Not Found\");    }    \n res.writeHead(200, {'Content-Type': 'text/html'}); //write HTML    \n res.write(data); //write data from rgb.html    return \n res.end();  });}io.sockets.on('connection', function \n (socket) {// Web Socket Connection  socket.on('rgbLed', \n function(data) { //get light switch status from client    \n console.log(data); //output data from WebSocket connection to console    \n //for common cathode RGB LED 0 is fully off, and 255 is fully on    redRGB=parseInt(data.red);\n     greenRGB=parseInt(data.green);    \n blueRGB=parseInt(data.blue);    ledRed.pwmWrite(redRGB); //set RED LED to specified \n value    ledGreen.pwmWrite(greenRGB); //set GREEN LED to \n specified value    ledBlue.pwmWrite(blueRGB); //set BLUE \n LED to specified value  });});process.on('SIGINT', \n function () { //on ctrl+c  ledRed.digitalWrite(0); // Turn RED LED \n off  ledGreen.digitalWrite(0); // Turn GREEN LED off  \n ledBlue.digitalWrite(0); // Turn BLUE LED off  process.exit(); //exit \n completely});\n\nPress \"Ctrl+x\" to save the code. Confirm with \"y\", and confirm the name with \"Enter\".\n\nUsing a Common Anode RGB LED\n\nWrite, or paste the following:\n\nrgbws.js\n\n var http = require('http').createServer(handler); //require http server, and \n create server with function handler()var fs = require('fs'); //require \n filesystem modulevar io = require('socket.io')(http) //require socket.io \n module and pass the http object (server)var Gpio = require('pigpio').Gpio, \n //include pigpio to interact with the GPIOledRed = new Gpio(4, {mode: \n Gpio.OUTPUT}), //use GPIO pin 4 as output for REDledGreen = new Gpio(17, \n {mode: Gpio.OUTPUT}), //use GPIO pin 17 as output for GREENledBlue = new \n Gpio(27, {mode: Gpio.OUTPUT}), //use GPIO pin 27 as output for BLUEredRGB \n = 255, //set starting value of RED variable to off (255 for common anode)\n greenRGB = 255, //set starting value of GREEN variable to off (255 for common \n anode)blueRGB = 255; //set starting value of BLUE variable to off (255 for \n common anode)//RESET RGB LEDledRed.digitalWrite(1); // Turn RED \n LED offledGreen.digitalWrite(1); // Turn GREEN LED off\n ledBlue.digitalWrite(1); // Turn BLUE LED offhttp.listen(8080); \n //listen to port 8080function handler (req, res) { //what to do on \n requests to port 8080  fs.readFile(__dirname + '/public/rgb.html', \n function(err, data) { //read file rgb.html in public folder    \n if (err) {      res.writeHead(404, \n {'Content-Type': 'text/html'}); //display 404 on error      \n return res.end(\"404 Not Found\");    }    \n res.writeHead(200, {'Content-Type': 'text/html'}); //write HTML    \n res.write(data); //write data from rgb.html    return \n res.end();  });}io.sockets.on('connection', function \n (socket) {// Web Socket Connection  socket.on('rgbLed', \n function(data) { //get light switch status from client    \n console.log(data); //output data from WebSocket connection to console    \n //for common anode RGB LED  255 is fully off, and 0 is fully on, so we \n have to change the value from the client    redRGB=255-parseInt(data.red);\n     greenRGB=255-parseInt(data.green);    \n blueRGB=255-parseInt(data.blue);    console.log(\"rbg: \" \n + redRGB + \", \" + greenRGB + \", \" + blueRGB); //output converted to console\n    ledRed.pwmWrite(redRGB); //set RED LED to specified \n value    ledGreen.pwmWrite(greenRGB); //set GREEN LED to \n specified value    ledBlue.pwmWrite(blueRGB); //set BLUE \n LED to specified value  });});process.on('SIGINT', \n function () { //on ctrl+c  ledRed.digitalWrite(1); // Turn RED LED \n off  ledGreen.digitalWrite(1); // Turn GREEN LED off  \n ledBlue.digitalWrite(1); // Turn BLUE LED off  process.exit(); //exit \n completely});\n\nPress \"Ctrl+x\" to save the code. Confirm with \"y\", and confirm the name with \"Enter\".\n\n\nRaspberry Pi and Node.js WebSocket UI\nNow it is time add the HTML that allows for user input via WebSocket.\nFor this we want:\n\n3 color sliders, one for each color (RGB)\nA color picker\nA div showing the current color\n\nGo to the folder \"public\":\n\n pi@w3demopi:~/nodetest $ \n cd public\n\nAnd create a HTML file, rgb.html:\n\n pi@w3demopi:~/nodetest/public $ \n nano rgb.html\n\nrgb.html:\n\n

RGB Color

\n
\n

\n

\n

\n

Or pick a color: \n

\n \n\nReturn to the \"nodetest\" folder: \n\n pi@w3demopi:~/nodetest $ \n cd ..\nRun the code:\n\n pi@w3demopi:~ $ sudo node rgbws.js\n\n\nNote: Since the \"pigpio\" module uses the pigpio C library, \n it requires root/sudo privileges to access hardware peripherals (like the \n GPIO).\n\nOpen the website in a browser using http://[RaspberryPi_IP]:8080/\nNow the RGB LED should change color depending on the user input.\nEnd the program with Ctrl+c.\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var http = require('http').createServer(handler); //require http server, and \n create server with function handler()var fs = require('fs'); //require \n filesystem modulevar io = require('socket.io')(http) //require socket.io \n module and pass the http object (server)var Gpio = require('pigpio').Gpio, \n //include pigpio to interact with the GPIOledRed = new Gpio(4, {mode: \n Gpio.OUTPUT}), //use GPIO pin 4 as output for REDledGreen = new Gpio(17, \n {mode: Gpio.OUTPUT}), //use GPIO pin 17 as output for GREENledBlue = new \n Gpio(27, {mode: Gpio.OUTPUT}), //use GPIO pin 27 as output for BLUEredRGB \n = 0, //set starting value of RED variable to off (0 for common cathode)\n greenRGB = 0, //set starting value of GREEN variable to off (0 for common \n cathode)blueRGB = 0; //set starting value of BLUE variable to off (0 for \n common cathode)//RESET RGB LEDledRed.digitalWrite(0); // Turn RED \n LED offledGreen.digitalWrite(0); // Turn GREEN LED off\n ledBlue.digitalWrite(0); // Turn BLUE LED offhttp.listen(8080); \n //listen to port 8080function handler (req, res) { //what to do on \n requests to port 8080  fs.readFile(__dirname + '/public/rgb.html', \n function(err, data) { //read file rgb.html in public folder    \n if (err) {      res.writeHead(404, \n {'Content-Type': 'text/html'}); //display 404 on error      \n return res.end(\"404 Not Found\");    }    \n res.writeHead(200, {'Content-Type': 'text/html'}); //write HTML    \n res.write(data); //write data from rgb.html    return \n res.end();  });}io.sockets.on('connection', function \n (socket) {// Web Socket Connection  socket.on('rgbLed', \n function(data) { //get light switch status from client    \n console.log(data); //output data from WebSocket connection to console    \n //for common cathode RGB LED 0 is fully off, and 255 is fully on    redRGB=parseInt(data.red);\n     greenRGB=parseInt(data.green);    \n blueRGB=parseInt(data.blue);    ledRed.pwmWrite(redRGB); //set RED LED to specified \n value    ledGreen.pwmWrite(greenRGB); //set GREEN LED to \n specified value    ledBlue.pwmWrite(blueRGB); //set BLUE \n LED to specified value  });});process.on('SIGINT', \n function () { //on ctrl+c  ledRed.digitalWrite(0); // Turn RED LED \n off  ledGreen.digitalWrite(0); // Turn GREEN LED off  \n ledBlue.digitalWrite(0); // Turn BLUE LED off  process.exit(); //exit \n completely});" + }, + { + "language": "javascript", + "code": "var http = require('http').createServer(handler); //require http server, and \n create server with function handler()var fs = require('fs'); //require \n filesystem modulevar io = require('socket.io')(http) //require socket.io \n module and pass the http object (server)var Gpio = require('pigpio').Gpio, \n //include pigpio to interact with the GPIOledRed = new Gpio(4, {mode: \n Gpio.OUTPUT}), //use GPIO pin 4 as output for REDledGreen = new Gpio(17, \n {mode: Gpio.OUTPUT}), //use GPIO pin 17 as output for GREENledBlue = new \n Gpio(27, {mode: Gpio.OUTPUT}), //use GPIO pin 27 as output for BLUEredRGB \n = 255, //set starting value of RED variable to off (255 for common anode)\n greenRGB = 255, //set starting value of GREEN variable to off (255 for common \n anode)blueRGB = 255; //set starting value of BLUE variable to off (255 for \n common anode)//RESET RGB LEDledRed.digitalWrite(1); // Turn RED \n LED offledGreen.digitalWrite(1); // Turn GREEN LED off\n ledBlue.digitalWrite(1); // Turn BLUE LED offhttp.listen(8080); \n //listen to port 8080function handler (req, res) { //what to do on \n requests to port 8080  fs.readFile(__dirname + '/public/rgb.html', \n function(err, data) { //read file rgb.html in public folder    \n if (err) {      res.writeHead(404, \n {'Content-Type': 'text/html'}); //display 404 on error      \n return res.end(\"404 Not Found\");    }    \n res.writeHead(200, {'Content-Type': 'text/html'}); //write HTML    \n res.write(data); //write data from rgb.html    return \n res.end();  });}io.sockets.on('connection', function \n (socket) {// Web Socket Connection  socket.on('rgbLed', \n function(data) { //get light switch status from client    \n console.log(data); //output data from WebSocket connection to console    \n //for common anode RGB LED  255 is fully off, and 0 is fully on, so we \n have to change the value from the client    redRGB=255-parseInt(data.red);\n     greenRGB=255-parseInt(data.green);    \n blueRGB=255-parseInt(data.blue);    console.log(\"rbg: \" \n + redRGB + \", \" + greenRGB + \", \" + blueRGB); //output converted to console\n    ledRed.pwmWrite(redRGB); //set RED LED to specified \n value    ledGreen.pwmWrite(greenRGB); //set GREEN LED to \n specified value    ledBlue.pwmWrite(blueRGB); //set BLUE \n LED to specified value  });});process.on('SIGINT', \n function () { //on ctrl+c  ledRed.digitalWrite(1); // Turn RED LED \n off  ledGreen.digitalWrite(1); // Turn GREEN LED off  \n ledBlue.digitalWrite(1); // Turn BLUE LED off  process.exit(); //exit \n completely});" + }, + { + "language": "javascript", + "code": "

RGB Color

\n
\n

\n

\n

\n

Or pick a color: \n

\n " + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_raspberrypi_components.asp", + "content": "Node.js Raspberry Pi - Components\n\n❮ Previous\nNext ❯\n\n\nWhat are Components?\nComponents are parts of a larger whole. In this chapter, we explain the different components we use in our tutorial.\n\nThe Raspberry Pi and GPIO Pins\n\nThis is an illustration of the Raspberry Pi 3.\nThe GPIO pins are the small \nred squares in two rows on the right side of the Raspberry Pi, on the actual Raspberry Pi they are small metal pins.\nInput pins are like switches that you can turn on or off from the outside \n world (like a on/off light switch).\nOutput pins are like switches that the Raspberry Pi can turn on or off (like \nturning on/off a LED light).\nThe Raspberry Pi 3 has 26 GPIO pins, the rest of the pins are power, ground \nor \"other\".\nThe pin placements correspond with the table below.\n\n\nRaspberry Pi B+, 2, 3 & Zero\n\n\n3V3\n1\n2\n5V\n\n\nGPIO 2\n3\n4\n5V\n\n\nGPIO 3\n5\n6\nGND\n\n\nGPIO 4\n7\n8\nGPIO 14\n\n\nGND\n9\n10\nGPIO 15\n\n\nGPIO 17\n11\n12\nGPIO 18\n\n\nGPIO 27\n13\n14\nGND\n\n\nGPIO 22\n15\n16\nGPIO 23\n\n\n3V3\n17\n18\nGPIO 24\n\n\nGPIO 10\n19\n20\nGND\n\n\nGPIO 9\n21\n22\nGPIO 25\n\n\nGPIO 11\n23\n24\nGPIO 8\n\n\nGND\n25\n26\nGPIO 7\n\n\nDNC\n27\n28\nDNC\n\n\nGPIO 5\n29\n30\nGND\n\n\nGPIO 6\n31\n32\nGPIO 12\n\n\nGPIO 13\n33\n34\nGND\n\n\nGPIO 19\n35\n36\nGPIO 16\n\n\nGPIO 26\n37\n38\nGPIO 20\n\n\nGND\n39\n40\nGPIO 21\n\n\n\n\nLegend\n\nPhysical Pin Number\nPower +\nGround\nUART\nI2C\nSPI\nGPIO\nDo Not Connect\n\n\n\n\n\n\n\n\n\nThe Breadboard\nA breadboard is used for prototyping electronics, it allows you to create \ncircuits without soldering. It is basically a plastic board, with a grid of \ntie-points (holes). Inside the board there are metal strips connecting the \ndifferent tie-points in specific ways.\nIn the illustration below we have highlighted some of the sections with different colors. This is to show you how the grid is connected.\n\nThe different sections of the breadboard:\n\nOn the left, and right, side there are 2 columns of tie-points. All the \n tie points in each of these columns are connected.\nThe Power Bus - The columns highlighted with red. There are usually used \n to connect power to the Breadboard. Since the entire column is connected, \n you can connect power to any of the tie-points in the column.\nThe Ground Bus - The columns highlighted with blue. There are usually \n used to connect Ground to the Breadboard. Since the entire column is \n connected, you can connect ground to any of the tie-points in the column.\nRows of connected Tie-Points - The rows highlighted with green. The \n tie-points of each of these rows are connected, but not the entire row! The \n left side tie-points are connected (A-B-C-D-E), and the right side \n tie-points are connected (F-G-H-I-J).\nIn the center of the Breadboard there is a Trench, this separates the \n left and right rows. The width of the trench is designed so that many \n Integrated Circuits fit across it.\n\n\nOther Electrical Components\n\n\n\nThrough Hole LED\nLight emitting diode (LED). An LED is a diode that emits light when a voltage is applied to it. In our example we use a Through Hole LED. \n They have a positive (called Anode), and a negative (called Cathode) pin. The \n longer leg on the LED should indicate the positive pin.\n\n\n\n\n\n\n\nRGB LED\nLight emitting diode (LED). An LED is a diode that emits light when a voltage is applied to it. An RGB LED has 4 pins. One for each color (R = Red, G = Green, and, B = Blue), and a common cathode/anode. This one LED can display the pure colors, or with PWD to modulate and mix colors.\n\n\n\n\n\n\n\nPush Button\nA push button is a type of switch. A switch makes or breaks a connection an an electric circuit.\n\n\n\n\n\n\n\nJumper Wire - Female to Male\nShort pieces of wire called jumper wires are used to make connections. \n Female to Male jumper wires can be used to connect from the GPIO on the \n Raspberry Pi to the Breadboard.\n\n\n\n\n\n\n\nJumper Wire - Male to Male\nShort pieces of wire called jumper wires are used to make connections. \n Male to Male jumper wires can be used to make connections between different \n parts of the Breadboard.\n\n\n\n\n\n\n\nResistor - 68 Ohm\nResistors are used to reduce current, adjust signal levels, etc. This is \n a 68 Ohm resistor.\n\n\n\n\n\n\n\nResistor - 220 Ohm\nResistors are used to reduce current, adjust signal levels, etc. This is \n a 220 Ohm resistor.\n\n\n\n\n\n\n\nResistor - 1k Ohm\nResistors are used to reduce current, adjust signal levels, etc. This is \n a 1k Ohm resistor.\n\n\n\n\n\n\n\n\nNode.js Modules\n\n\n\nonoff - GPIO access and interrupt detection with Node.js\n\n\ndocumentation\n\n\n\n\nSocket.IO - real-time bidirectional event-based communication\n\n\ndocumentation\n\n\n\n\npigpio - wrapper for pigpio C library. Enables GPIO, PWM, servo control, state change notification and interrupt handling with Node.js\n\n\ndocumentation\n\n\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/ref_modules.asp", + "content": "Node.js Built-in Modules\n\n❮ Previous\nNext ❯\n\n\nNode.js has a set of built-in modules which you can use without any further \ninstallation.\nHere is a list of the built-in modules of Node.js version 6.10.3:\n\n\nModule\nDescription\n\nassertProvides a set of assertion tests\nbufferTo handle binary data\nchild_processTo run a child process\nclusterTo split a single Node process into multiple processes\ncryptoTo handle OpenSSL cryptographic functions\ndgramProvides implementation of UDP datagram sockets\ndnsTo do DNS lookups and name resolution functions\ndomainDeprecated. To handle unhandled errors\neventsTo handle events\nfsTo handle the file system\nhttpTo make Node.js act as an HTTP server\nhttpsTo make Node.js act as an HTTPS server.\nnetTo create servers and clients\nosProvides information about the operation system\npathTo handle file paths\npunycodeDeprecated. A character encoding scheme\nquerystringTo handle URL query strings\nreadlineTo handle readable streams one line at the time\nstreamTo handle streaming data\nstring_decoderTo decode buffer objects into strings\ntimersTo execute a function after a given number of milliseconds\ntlsTo implement TLS and SSL protocols\nttyProvides classes used by a text terminal\nurlTo parse URL strings\nutilTo access utility functions\nv8To access information about V8 (the JavaScript engine)\nvmTo compile JavaScript code in a virtual machine\nzlibTo compress or decompress files\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_compiler.asp", + "content": "Node.js Online Compiler\n\n❮ Previous\nNext ❯\n\n\nNode.js Compiler (Editor)\nBuild and host your own website with W3Schools Spaces with a Node.js environment.\nW3Schools Spaces is a website-building tool that enables you to create and share your own website and you can get a Node.js environment to run your web applications.\nYou have full control over the website's appearance and functionality by editing the code directly in your web browser.\nThe tool is user-friendly and requires no setup, making it easy to use.\n\n\n\nThe code editor is packed with features to help you achieve more:\n\nTemplates: Start from scratch or use a template\nCloud-based: no installations required. You only need your browser\nTerminal & Log: debug and troubleshoot your code easily\nFile Navigator: switch between files inside the code editor\nAnd much more!\n\nLearn More\n\nLearn Faster\nPractice is key to mastering coding, and the best way to put your Node.js knowledge into practice is by getting practical with code. \nUse W3Schools Spaces to build, test and deploy code.\nThe code editor lets you write and practice different types of computer languages. It includes \nNode.js, but you can use it for other languages too. \nNew languages are added all the time:\n\n\n\nLearn More\n\nIf you don't know Node.js, we suggest that you read our Node.js Tutorial from scratch.\n\n\nEasy Package Management\nGet an overview of your packages and easily add or delete frameworks and libraries. Then, with just one click, you can make changes to your packages without manual installation.\n\nLearn More\n\n\nBuild Powerful Websites\nYou can use the code editor in W3School Spaces to build frontend or full-stack websites from scratch.\nOr you can use the 60+ templates available and save time:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nCreate your Spaces account today and explore them all!\nLearn More\n\nShare Your Website With The World\nHost and publish your websites in no time with W3School Spaces.\nW3Schools subdomain and SSL certificate are included for free with W3School Spaces. An SSL certificate makes your website safe and secure. It also helps people trust your website and makes it easier to find it online.\nWant a custom domain for your website?\nYou can buy a domain or transfer an existing one and connect it to your space.\nLearn More\n\nHow Does It Work?\nGet started in a few clicks with W3School Spaces.\n\n\n\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_server.asp", + "content": "Node.js Server\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\nCreate Node.js Server\n\nHost Node.js code with W3Schools Spaces\nGet Started Now!\n\n\n\n\n\n\nPractice\nCoding Skills\n\n\n\n\n\n\n\n\nkAI\nAI Tutor\n\n\n\n\n\nBuild\nProjects\n\n\n\n\n\nHost\nSecurely\n\n\n\n\n\n\n\n\n\n\n\n\n Choose your Plan\n \n\n By subscribing to a plan you support the W3Schools mission to make\n \n learning available to everyone - no matter their background.\n \n\n\n\nMonthly\n\n\n\n\nAnnually\n\n\n\n\n\n\n\n\n\nFree\n\n $0\n /Forever\n\n\n\n\nThis is for you that are beginning to explore coding and web development\n\nTrack your progress\nSet your goals\nBuild and host 1 static website\n100 credits/month\n \n\n\n\nAccess various AI features like W3Schools kAI coding tutor and interview preparation.\n\n\nNo support\n\n\n\n\n Get Free\n \n\n\n\n\nW3Schools Plus\n\n $14.99\n /Month\n\n\n\n\nThis is for you that want to learn and reach your goals faster. Build fullstack projects, ad free experience.\n\nAd-free experience\nUnlimited challenges\nUnlimited practice tests\nBuild and host 15 static websites\nBuild and host 1 full stack server\n\nChoose from 75+ templates\n10000 credits/month\n \n\n\n\nAccess various AI features like W3Schools kAI coding tutor and interview preparation.\n\n\n\nCancel anytime\n\n\n\n\n Get Plus\n \n\n\n\n\nW3Schools Academy\nFor teachers\n\n\n\nSpend less time on admin tasks while engaging your students. Help them learn, practice and collaborate. All in one place.\n\nAd-free for focused learning\nDashboard to manage your classroom\nStudy plans for structured learning\nTrack progress with insights\nInteractive code challenges and projects\nAccess to all courses and certification exams\nSpaces for building and publishing projects\n\n\n\n\n Get More Info\n \n\n\n\n\n\n\n\n\n\n\n\nNEW SUBSCRIBER DEAL\n25% OFF\nFOR A YEAR\n\n\nUSE PROMO CODE:\nSPACES25\n \n\n\n\n\nWant custom domains?\nYou can also buy a domain or connect an existing one.\nLooking to add multiple users?\n\n Read here for how to get in touch\n \n\n\n\n\n\n\n\nPowerful Code Editor\nFront-end, Back-end or Full-stack - the choice is yours\n \n\n \n\n\n\n\n\n\nPractice Makes Perfect\nSharpen and Master your development skills with these technologies using Spaces.\n \nGet Started Now!\n\n\n\n\n\n\n\n\n\nSave Time with Templates\nBuild powerful websites in just a few clicks\n\n\n\n\nPortfolio \n\n\n\nBlog \n\n\n\n\n\nWebshop \n\n\n\nTutor \n\n\nExplore All Templates \nGet Started Now!\n\n\n\n\n\n\n\n\n\n\nkAI\nJust landed in Spaces\nLearn to code more effectively and intelligently with kAI - AI tutor\nGet Started Now!\n\n\n\n\n\n\n\nHi! I'm kAI, W3Schools AI Tutor...\nFeel free to ask me any coding-related questions, and I'll do my best to assist you.\nI can help you checking your code for errors, improving your code's structure, explaining coding concepts in a clear and understandable way, and more...\nI can even create complete websites for you based on your input, so what are you waiting for?\n\n\n\n\n\n\n\n\nSuper Simple to Share\nHost and Publish Websites in no time\n\n\n\nIncluded for free in all plans\nW3Schools subdomain, hosting, and SSL certificate.\nWant custom domains?\nBuy a domain or transfer an existing one and connect it to your space.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nHow it works\n\n\n\n1. Join W3Schools- and create a space\n\n\n\n2. Choose a template- or start from scratch\n\n\n\n3. Edit code directlyin your browser\n\n\n\n4. Share your websitewith the world\n\n\n\n\n\n\n\nCoding Made Easy\nAll at your fingertips with our easy-to-use code editor\n\nCloud-based\nTerminal & Log\nHow To Libraries\nDatabase\nFile Navigator\nPackage Manager\nAnalytics\nEnvironment Manager\n\n\nGet Started Now!\n\n\n\n\n\n\n\nCloud-Based\nSave Time & Money.\nNo installation required. Access everything in your browser. Get started in seconds.\nGet Started Now!\n\n\n\n\n\n\n\n\n\n\n\n\nFile Navigator\nAll Your Files in One Place.\nFind and switch easily between your code files without leaving the code editor.\nGet Started Now!\n\n\n\n\n\n\n\n\n\n\nTerminal and Log\nFix Your Code Faster.\nMonitor your code, debug and troubleshoot your work during the development process.\nGet Started Now!\n\n\n\n\n\n\n\n\n\n\nDatabase\nGet Full Data Visibility.\nFind and preview all the data stored in your website. Anytime, from anywhere.\nGet Started Now!\n\n\n\n\n\n\n\n\n\n\nEnvironment Manager\nIncreased Control and Security.\nControl your website access points to establish secure connections.\nGet Started Now!\n\n\n\n\n\n\n\n\n\n\nPackage Manager\nFind What You Need Quicker.\nSearch and install frameworks and libraries in just one click.\nGet Started Now!\n\n\n\n\n\n\n\n\n\n\nUser Analytics\nGet Traffic Insights.\nLearn from your website visitors to deliver a better user experience.\nGet Started Now!\n\n\n\n\n\n\n\n\n\n\n\n\nGet Inspired\nConnect and share your website with the community to get instant feedback\nGet Started Now!\n\n\n\n\n\n\n\n\n\n\n\n\n\nFrequently Asked Questions\n     What's the difference between 'Basic' and 'Full Stack' Spaces?\n\nWith Basic Spaces, you can build frontend websites. Whereas with Fullstack Spaces, you can build frontend and backend websites.\n\n     Which programming languages are included in 'Basic' and 'Full Stack' Spaces?\n\nBasic Spaces include HTML, CSS, and Javascript. Full Stack Spaces include everything in Basic Spaces plus PHP, Python, React.js, Vue.js, Node.js, Handlebars, and Django.\n\n     How are subscriptions renewed?\n\nYour subscription will be automatically renewed every month.\n\n     What happens if I cancel my subscription?\n\nYour access to all the benefits for the paid period of time will continue. However, the subscription will not be renewed automatically.\n\n     Can I subscribe to multiple accounts at once?\n\nTo subscribe W3Schools accounts for multiple users, you can contact sales@w3schools.com\n\n\nHave some other questions? Visit our support page\nSubscribe for $14.99/Month\nCancel anytime.\n\n\n\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_syllabus.asp", + "content": "Node.js Syllabus\n\n❮ Previous\nNext ❯\n\n\nIntroduction\n\nThe W3Schools Node.js Tutorial is comprehensive and beginner-friendly.\nIt will give you a fundamental knowledge of Node.js.\nIt is designed for beginners and requires only basic JavaScript knowledge.\nThe content has been carefully made to be bite-sized, simple, and easy to understand.\nThe content has been proven by millions of users over the years. It is updated and improved frequently.\nThe syllabus outline and its sequence are structured so you can learn Node.js step by step, from the introduction to creating server-side applications.\nGet Started With Node.js »\n\nLearning Outcomes\n\nLearn what Node.js is and set up your environment\nCreate web servers with the HTTP module\nWork with built-in modules (File System, URL, Events)\nUse Node Package Manager (NPM) to manage packages\nHandle files (upload, read, create, update, delete)\nSend emails using Node.js\nConnect and work with MySQL database\nCreate and manage MongoDB databases\nBuild real-world applications with Node.js\n\n\nNote: Are you a teacher teaching Node.js? W3Schools Academy is a toolbox of features that can help you teach. It offers classroom features such as pre-built study plans, classroom administration and much more. Read more about Academy here.\n\n\nWhich Subjects Are Node.js Relevant For?\n\nBack-end Development: Node.js is essential for server-side application development.\nWeb Development: Node.js enables full-stack JavaScript development.\nAPI Development: Node.js is perfect for building RESTful APIs and microservices.\nReal-time Applications: Node.js excels at handling real-time data and WebSocket connections.\nDevOps: Node.js is widely used for build tools and automation.\nCloud Computing: Node.js is popular for cloud-native application development.\nEnterprise Applications: Node.js supports building scalable enterprise solutions.\n\nGet Started\n\nSign in to Track Progress\nYou can also create a free account to track your progress.\nAs a signed-in user, you get access to features such as:\n\nLearning paths\nSandbox and lab environments\nAchievements\nAnd much more!\n\nSign Up - It's free\n\nOverview of the Modules\n\n\n\nNode.js HOME\nNode.js Intro\nNode.js Get Started\nNode.js Modules\nNode.js HTTP Module\nNode.js File System\nNode.js URL Module\nNode.js NPM\nNode.js Events\nNode.js Upload Files\nNode.js Email\nMySQL Get Started\nMySQL Create Database\nMySQL Create Table\nMySQL Insert Into\nMySQL Select From\nMySQL Where\nMySQL Order By\nMySQL Delete\nMySQL Drop Table\nMySQL Update\nMySQL Limit\nMySQL Join\nMongoDB Get Started\nMongoDB Create DB\nMongoDB Collection\nMongoDB Insert\nMongoDB Find\nMongoDB Query\nMongoDB Sort\nMongoDB Delete\nMongoDB Drop Collection\nMongoDB Update\nMongoDB Limit\nMongoDB Join\nRasPi Get Started\nRasPi GPIO Introduction\nRasPi Blinking LED\nRasPi LED & Pushbutton\nRasPi Flowing LEDs\nRasPi WebSocket\nRasPi RGB LED WebSocket\nRasPi Components\nNode.js Certificate\n\n\nGet Started\n\nSandbox and Lab Environment\nNode.js, like any other platform, is best learned through hands-on practice.\nTry this example using our editor:\n\nExample\n\n var http = require('http');http.createServer(function (req, res) {  res.writeHead(200, {'Content-Type': 'text/plain'});  res.end('Hello World!');}).listen(8080); \nRun example »\n\nIf you want to explore more and host your project, we have a feature called Spaces \nthat allows you to build, test and deploy Node.js applications for free.\nHere you get a secure sandbox environment called Spaces, where you can practice Node.js code and test projects in real-time.\nSpaces allow you to test, build, and deploy code. This includes a W3Schools subdomain, hosting, and secure SSL certificates.\nSpaces require no installation and run directly in the browser.\nFeatures include:\n\nCollaboration\nFile navigator\nTerminal & log\nPackage manager\nDatabase\nEnvironment manager\nAnalytics\n\n\n\n\nCreate a Spaces Account\n\nNode.js Certification\nW3Schools offers an end-of-pathway certification program.\nHere you can take exams to get certified.\nThe Node.js exam is a test that summarizes the W3Schools Node.js syllabus.\nAfter passing the exam you get the \"Certified Node.js Developer\" Certification.\nThe certification exam is adaptive and graded; students will get a grade from intermediate, advanced to professional.\n\n\n\nBuy Certificate »\n\nAre You a Teacher?\nAre you interested in learning how you can use W3Schools Academy to Teach \nNode.js? \nWatch a demo of W3Schools Academy. You'll see how it works, and discover how it can make teaching programming easier and more engaging.\n\n\n\nWatch Demo »\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [ + { + "language": "javascript", + "code": "var http = require('http');http.createServer(function (req, res) {  res.writeHead(200, {'Content-Type': 'text/plain'});  res.end('Hello World!');}).listen(8080);" + } + ], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_study_plan.asp", + "content": "Node.js Study Plan\n\n❮ Previous\nNext ❯\n\n\nIntroduction\nThe Node.js study plan helps you teach your students Node.js step-by-step.\nCreating a study plan for Node.js is easy.\nYou can use a pre-built study plan or customize it.\nStudents have different skill levels. The study plans can be customized to ensure that everyone is challenged.\nSave time with pre-built teacher materials and study plans. Easily organize your class with a timeline from the introduction of Node.js to the final exam.\n\nW3Schools Academy\nThis study plan is a feature of W3Schools Academy.\nW3Schools Academy is a platform that has everything you need to teach coding, all in one place.\nIt offers you as a teacher a toolbox of features that helps you succeed with teaching in your classroom.\nYou need to have an active subscription to access the study plan feature. There are two different subscription tiers:\n\nEssentials ($1.99 / month per student)\nFull Access ($5.99 / month per student)\nCalculate your price and order here.\n\nLearn More »\nAcademy also offer other features such as:\n\nManaging your classroom\nTracking of student progress and reports\nLabs, assignments, and code challenges (prebuilt challenges or create your own ones)\nAuto-grading\nTeaching materials\nCertification exams\n\nGet a free demo »\n\nTeacher Materials\nW3Schools has everything you need to teach Node.js.\nThe Node.js training materials is available for you to include and use in your study plan:\n\nW3Schools Node.js Tutorial\nNode.js Challenges (Coding challenges)\nNode.js Certification Exam (End of Pathway Exam)\n\n\nNode.js Syllabus\nWith the Node.js Syllabus, your students will start with the basics, like setting up a Node.js environment and running simple scripts, and move to more advanced topics, like building servers, handling asynchronous events, and creating dynamic applications. Each chapter includes examples, try-it-yourself sections, exercises, and quizzes to make learning easy, interactive, and fun.\nRead more about Node.js Syllabus.\n\nStudy Plan Overview\nThe study plan features are made to help teachers and students. They make learning easy, flexible, and fun. These features work for different types of classes, learning styles and student level.\n\n\n\nLearning Paths\n\nYou can add ready-made learning paths.\nThe learning paths are by default ordered by our recommended order.\nYou can change the order.\nYou can add custom activities with text, links, or multi-media files.\nDrag and drop or click to make changes to the path.\n\n\n\nInteractive Content\n\nTutorials\nTry-its (test code snippets)\nExercises\nQuiz\nChallenges\nLabs\n\n\n\nTimeline and Pace\n\nYou can set a timeline of your study plan (e.g., 4-week, 8-week, 12-week, 24-week plans).\nYou can decide the learning pace for your class.\nDifferent study plans can be assigned to different students in the same class.\nThe flexibility can help to make sure that everyone is challenged.\n\n\n\nTrack Student Progress\n\nThere are tools to track student progress.\nThe analytic tools include: chapter progress, exercises results, quiz results, exam results, and much more.\nThe challenges can be auto-graded or manually graded. The results are available to you as a teacher.\n\n\n\nEnd of Pathway Exam\n\nThe Node.js study plan aligns with the Node.js Certification Exam.\nThe exam can be taken at the end of the study plan, at your selected date.\nThe exam summarizes the Node.js Tutorial.\nYou get reports of the students' results.\n\n\n\nAccessibility\n\nStudy plans and learning materials are accessible on desktops, tablets, and smartphones.\nThis ensures students can learn anytime, anywhere.\n\n\n\nLearn More »\n\nSample Study Plan\nYou choose the timeline and pace of your study plans.\nSchools have different preferences.\nSome would like more intensive pace, e.g. 5 weeks, others 12 or more weeks.\nIt is completely up to you.\nFor example, this is how a 5-week Node.js study plan could look like:\n\nWeek 1: Essentials\nWeek 2: Modules, HTTP Modules, File System, URL Module, NPM, Events, Upload Files, Email\nWeek 3: Working with MySQL, Working with MongoDB, Node.js Certification Exam\n\nImage of Sample Node.js study plan:\n\n\nReady to get started?\nStart with Node.js Study Plans today.\nGet Started »\n\nAre You a Teacher?\nAre you interested in learning how you can use W3Schools Academy to Teach Node.js programming? \nWatch a demo of W3Schools Academy. You'll see how it works, and discover how it can make teaching programming easier and more engaging.\n\n\n\nWatch Demo »\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [], + "next_link": "https://profile.w3schools.com/log-in" + }, + { + "title": "No Title Found", + "url": "https://www.w3schools.com/nodejs/nodejs_exam.asp", + "content": "W3Schools Node.JS Certificate\n\n❮ Previous\nNext ❯\n\n\n\n\nw3schools CERTIFIED . 2025\n\n  \n\nW3Schools offers an Online Certification Program.\nThe perfect solution for busy professionals who need to balance work, family, and career building.\nMore than 50 000 certificates already issued!\n\nGet Your Certificate »\n\n\n\n\nw3schools CERTIFIED . 2025\nW3Schools offers an Online Certification Program.\nThe perfect solution for busy professionals who need to balance work, family, and career building.\nMore than 50 000 certificates already issued!\nGet Your Certificate »\n\n\n\n\n\n\n\n\n\n\nDocument your skillsImprove your career\n\n\n\n\nStudy at your own paceSave time and money\n\n\n\n\nKnown brandTrusted by top companies\n\n\n\n\n\n\n\nWho Should Consider Getting Certified?\nAny student or professional within the digital industry.\nCertifications are valuable assets to gain trust and demonstrate knowledge to your clients, current or future employers on a ever increasing competitive market.\nW3Schools is Trusted by Top Companies\nW3Schools has over two decades of experience with teaching coding online.\nOur certificates are recognized and valued by companies looking to employ skilled developers.\nSave Time and Money\nShow the world your coding skills by getting a certification.\nThe prices is a small fraction compared to the price of traditional education.\nDocument and validate your competence by getting certified!\n\n\nExam overview\nFee: 95 USD\nAchievable certification levels:\nIntermediate (40%)\n Advanced (75%)\n Professional (90%)\nNumber of questions:\nAdaptive, 60 on average\nRequirement to pass:\nMinimum 40% - Intermediate level\nTime limit: 60 minutes\nNumber of attempts to pass: 3\nExam deadline: None\nCertification Expiration: None\nFormat: Online, multiple choice\nRegister now »\n\n\n\nAdvance Faster in Your Career\nGetting a certificate proves your commitment to upgrading your skills.\nThe certificate can be added as credentials to your CV, Resume, LinkedIn profile, and so on.\nIt gives you the credibility needed for more responsibilities, larger projects, and a higher salary.\nKnowledge is power, especially in the current job market.\nDocumentation of your skills enables you to advance your career or helps you to start a new one.\n\n\nHow Does It Work?\n\nStudy for free at W3Schools.com\nStudy at your own speed\nTest your skills with W3Schools online quizzes\nApply for your certificate by paying an exam fee\nTake your exam online, at any time, and from any location\n\n\n\nGet Your Certificate and Share It With The World\nExample certificate:\n\nEach certificate gets a unique link that can be shared with others.\nValidate your certification with the link or QR code.\nCheck how it looks like in this Example.\nShare your certificate on Linked in the Certifications section in just one click!\n\n\nDocument Your Skills\nGetting a certificate proves your commitment to upgrade your skills,\n gives you the credibility needed for more responsibilities, larger projects, and a higher salary.\nGet Your Certificate »\n\n\nLooking to add multiple users?\nAre you an educator, manager or business owner looking for courses or certifications?\nWe are working with schools, companies and organizations from all over the world.\nGet courses and/or certifications for your team here.\n\n\n\n❮ Previous\nNext ❯\n\n\n\n\n\n\n\n\n\n\n\n\n★\n+1\n\n\n\n \n\n\n\nTrack your progress - it's free!\n\n\n \n\n\n\n\n\n\n\n Log in\n \n\n Sign Up", + "code_examples": [], + "next_link": "https://profile.w3schools.com/log-in" + } + ], + "metadata": { + "viewport": "width=device-width, initial-scale=1", + "title": "W3Schools.com", + "Keywords": "HTML, Python, CSS, SQL, JavaScript, How to, PHP, Java, C, C++, C#, jQuery, Bootstrap, Colors, W3.CSS, XML, MySQL, Icons, NodeJS, React, Graphics, Angular, R, AI, Git, Data Science, Code Game, Tutorials, Programming, Web Development, Training, Learning, Quiz, Exercises, Courses, Lessons, References, Examples, Learn to code, Source code, Demos, Tips, Website", + "Description": "Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.", + "msapplication-TileColor": "#00a300", + "theme-color": "#ffffff" + } +} \ No newline at end of file diff --git a/data/raw/tutorial_info.csv b/data/raw/tutorial_info.csv new file mode 100644 index 0000000..93e6283 --- /dev/null +++ b/data/raw/tutorial_info.csv @@ -0,0 +1,50 @@ +title,url +No Title Found,https://www.w3schools.com/nodejs/default.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_intro.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_get_started.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_modules.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_http.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_filesystem.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_url.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_npm.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_events.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_uploadfiles.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_email.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mysql.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mysql_create_db.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mysql_create_table.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mysql_insert.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mysql_select.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mysql_where.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mysql_orderby.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mysql_delete.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mysql_drop_table.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mysql_update.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mysql_limit.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mysql_join.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mongodb.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mongodb_create_db.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mongodb_createcollection.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mongodb_insert.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mongodb_find.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mongodb_query.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mongodb_sort.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mongodb_delete.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mongodb_drop.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mongodb_update.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mongodb_limit.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_mongodb_join.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_raspberrypi.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_raspberrypi_gpio_intro.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_raspberrypi_blinking_led.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_raspberrypi_led_pushbutton.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_raspberrypi_flowing_leds.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_raspberrypi_webserver_websocket.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_raspberrypi_rgb_led_websocket.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_raspberrypi_components.asp +No Title Found,https://www.w3schools.com/nodejs/ref_modules.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_compiler.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_server.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_syllabus.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_study_plan.asp +No Title Found,https://www.w3schools.com/nodejs/nodejs_exam.asp diff --git a/data/raw/tutorial_modules.csv b/data/raw/tutorial_modules.csv new file mode 100644 index 0000000..ea05a71 --- /dev/null +++ b/data/raw/tutorial_modules.csv @@ -0,0 +1,50 @@ +title,url +Node.js HOME,https://www.w3schools.com/nodejs/default.asp +Node.js Intro,https://www.w3schools.com/nodejs/nodejs_intro.asp +Node.js Get Started,https://www.w3schools.com/nodejs/nodejs_get_started.asp +Node.js Modules,https://www.w3schools.com/nodejs/nodejs_modules.asp +Node.js HTTP Module,https://www.w3schools.com/nodejs/nodejs_http.asp +Node.js File System,https://www.w3schools.com/nodejs/nodejs_filesystem.asp +Node.js URL Module,https://www.w3schools.com/nodejs/nodejs_url.asp +Node.js NPM,https://www.w3schools.com/nodejs/nodejs_npm.asp +Node.js Events,https://www.w3schools.com/nodejs/nodejs_events.asp +Node.js Upload Files,https://www.w3schools.com/nodejs/nodejs_uploadfiles.asp +Node.js Email,https://www.w3schools.com/nodejs/nodejs_email.asp +MySQL Get Started,https://www.w3schools.com/nodejs/nodejs_mysql.asp +MySQL Create Database,https://www.w3schools.com/nodejs/nodejs_mysql_create_db.asp +MySQL Create Table,https://www.w3schools.com/nodejs/nodejs_mysql_create_table.asp +MySQL Insert Into,https://www.w3schools.com/nodejs/nodejs_mysql_insert.asp +MySQL Select From,https://www.w3schools.com/nodejs/nodejs_mysql_select.asp +MySQL Where,https://www.w3schools.com/nodejs/nodejs_mysql_where.asp +MySQL Order By,https://www.w3schools.com/nodejs/nodejs_mysql_orderby.asp +MySQL Delete,https://www.w3schools.com/nodejs/nodejs_mysql_delete.asp +MySQL Drop Table,https://www.w3schools.com/nodejs/nodejs_mysql_drop_table.asp +MySQL Update,https://www.w3schools.com/nodejs/nodejs_mysql_update.asp +MySQL Limit,https://www.w3schools.com/nodejs/nodejs_mysql_limit.asp +MySQL Join,https://www.w3schools.com/nodejs/nodejs_mysql_join.asp +MongoDB Get Started,https://www.w3schools.com/nodejs/nodejs_mongodb.asp +MongoDB Create DB,https://www.w3schools.com/nodejs/nodejs_mongodb_create_db.asp +MongoDB Collection,https://www.w3schools.com/nodejs/nodejs_mongodb_createcollection.asp +MongoDB Insert,https://www.w3schools.com/nodejs/nodejs_mongodb_insert.asp +MongoDB Find,https://www.w3schools.com/nodejs/nodejs_mongodb_find.asp +MongoDB Query,https://www.w3schools.com/nodejs/nodejs_mongodb_query.asp +MongoDB Sort,https://www.w3schools.com/nodejs/nodejs_mongodb_sort.asp +MongoDB Delete,https://www.w3schools.com/nodejs/nodejs_mongodb_delete.asp +MongoDB Drop Collection,https://www.w3schools.com/nodejs/nodejs_mongodb_drop.asp +MongoDB Update,https://www.w3schools.com/nodejs/nodejs_mongodb_update.asp +MongoDB Limit,https://www.w3schools.com/nodejs/nodejs_mongodb_limit.asp +MongoDB Join,https://www.w3schools.com/nodejs/nodejs_mongodb_join.asp +RasPi Get Started,https://www.w3schools.com/nodejs/nodejs_raspberrypi.asp +RasPi GPIO Introduction,https://www.w3schools.com/nodejs/nodejs_raspberrypi_gpio_intro.asp +RasPi Blinking LED,https://www.w3schools.com/nodejs/nodejs_raspberrypi_blinking_led.asp +RasPi LED & Pushbutton,https://www.w3schools.com/nodejs/nodejs_raspberrypi_led_pushbutton.asp +RasPi Flowing LEDs,https://www.w3schools.com/nodejs/nodejs_raspberrypi_flowing_leds.asp +RasPi WebSocket,https://www.w3schools.com/nodejs/nodejs_raspberrypi_webserver_websocket.asp +RasPi RGB LED WebSocket,https://www.w3schools.com/nodejs/nodejs_raspberrypi_rgb_led_websocket.asp +RasPi Components,https://www.w3schools.com/nodejs/nodejs_raspberrypi_components.asp +Built-in Modules,https://www.w3schools.com/nodejs/ref_modules.asp +Node.js Compiler,https://www.w3schools.com/nodejs/nodejs_compiler.asp +Node.js Server,https://www.w3schools.com/nodejs/nodejs_server.asp +Node.js Syllabus,https://www.w3schools.com/nodejs/nodejs_syllabus.asp +Node.js Study Plan,https://www.w3schools.com/nodejs/nodejs_study_plan.asp +Node.js Certificate,https://www.w3schools.com/nodejs/nodejs_exam.asp diff --git a/main.py b/main.py new file mode 100644 index 0000000..9386879 --- /dev/null +++ b/main.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python +""" +Main entry point for the web scrapers application. +""" +import argparse +import logging +import sys + +from src.scrapers.w3schools import W3SchoolsScraper +from src.app import ScraperApplication + +# Configure logging +logging.basicConfig( + level=logging.INFO, + format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', + handlers=[ + logging.StreamHandler(sys.stdout), + logging.FileHandler('scrapers.log') + ] +) +logger = logging.getLogger(__name__) + + +def parse_arguments(): + """Parse command line arguments""" + parser = argparse.ArgumentParser(description='Web scrapers for tutorial websites') + parser.add_argument( + '--url', + type=str, + default="https://www.w3schools.com/nodejs/nodejs_intro.asp", + help='Starting URL for the scrapers' + ) + parser.add_argument( + '--output', + type=str, + default="data/raw", + help='Output directory for scraped data' + ) + parser.add_argument( + '--delay', + type=float, + default=1.0, + help='Delay between requests in seconds' + ) + return parser.parse_args() + + +def main(): + """Main function to run the scrapers""" + try: + args = parse_arguments() + + # Log startup information + logger.info("Starting Web Scraper") + logger.info(f"URL: {args.url}") + logger.info(f"Output directory: {args.output}") + logger.info(f"Request delay: {args.delay} seconds") + + # Create the scrapers + w3schools_scraper = W3SchoolsScraper(args.url, delay=args.delay) + + # Create the application + app = ScraperApplication(w3schools_scraper) + + # Run the application + data = app.run(args.output) + + # Access and print metadata + logger.info("\nMetadata from the course:") + for key, value in data["metadata"].items(): + logger.info(f" {key}: {value}") + + logger.info("\nScraping and export completed!") + return 0 + except Exception as e: + logger.error(f"Error in main: {e}", exc_info=True) + return 1 + + +if __name__ == "__main__": + sys.exit(main()) \ No newline at end of file diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/__pycache__/__init__.cpython-312.pyc b/src/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2da7f5be227f71183eb4fc8b632639d3b4049da9 GIT binary patch literal 150 zcmX@j%ge<81iBahri19mAOanHW&w&!XQ*V*Wb|9fP{ah}eFmxdWvU-qoLW?@pO{!w zl2NH2P??;OSd<%3l%JKFTvDv>=owO4l3%1>T$HRIAD@|*SrQ+wS5SG2!zMRBr8Fni Xu80+A3L_8~gBTx~85tRin1L(+=^G?F literal 0 HcmV?d00001 diff --git a/src/__pycache__/app.cpython-312.pyc b/src/__pycache__/app.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..568afef82f0c5e80df727e4b2f30f48039da2688 GIT binary patch literal 3234 zcmbVOU2Gf25#IYFdHiusvMg1@6dUAOkn`g98Mx{8Bk^i&PJVWVk@}&puFotfR)8P0w)e@La`fQ(;!{-5lRV*vb_E`q@~iS0!~ECB-;j0rOSm&q_> z&6;e1%Wwrg!xw~%z)%@yMhekP)T4PbRuD6yM+;`WkjNxFI$|aZsZ5FiEPzbDFEF_C zh0ok!{8dI`!5LsguL2`>hi&rO78phR8(mB*oXfwG)3M8)EH1dQb0wU!ikhh~ZhQv5 zlh%<|f{3i7nIma^&azB>HX-e*{Y z$#4b>`B~QBuJRedh#5SL7y^vK2#n3L-9&qqHzHSsjJOb0M7OqxI zjFiZqs;aqS4y$UV_v!eJ1VV`%Z}*ew3fSx#xW<2+yx*_fdixsRi1pm>J9z8$Yy7=f z_cl=gZrm#4QW>j84!IEoaTygK3u1&Qc|rUMnU?@=<{|+3Fj({)e^eQR`6V0VCIhe# zNG@|`clmVich*=O z3iC8xPmKKDCm3W&yyJs=);MCb<7u6I*VDWzTjhd%BqpK4*RU%D`)fS0`;G93kl5XB zz9&=&iE8Kri5t5c;=BT`3p$$xI{Q{H05zd1BK(`*A-HYLS}o zfB6~>eT{w%UnA8h!5lHm-f2E;66yb)Me&yWVe|V#7eXS)m2~S#2Sag47^$6;uoAF$ zxF0e)%aCZ+gn6(Z;Nd`H7@&b#tmT%wot>!09?$g;fsw4mK8VdT^WZY~eK5}`dn&^h z%0&W}(8ouDDJ}Tu@eK`Y7YX*q;N_f+RqNf#u{0*IL!q>Zon%i7^3Lb*oa|$ROt66f zl7$w=h9eaDTDS$vD4Wn8A>cDPSkqUnrRnLqoR9x(;o7wrrXUm1j>QWFeVUi`_0iE>Bmw-zeJUl2^~j zUcdI)GF~V_WuMDhwi_#G??U34?Z$INca(Q}NH{~DEblT-h z8lH3cyp=1WJ)X9Y{fI)28*K)`6$6*;9aml6pfy@NeOZTIg?0r}F)ZZ9-_*=9^c+(} zL@^0bfN>LkpjG-8HVe&c&V)s+09~nRNewv+c2j{>QY*;S+k>Uuq6KYQqvT+qHfo7O zyWdQDX7zYRA3U2w5jP7mX$JhS?ZCdM|No zi|tBv-j_O;5;qdgK-#(Zwv$$!z8^LuZF6AgQ}YvZV_>X4Ft$E0zL+4p2luZ;m!m7m z<>YF{IdN`XKEIgSlsYz~p}I7*At`l9S$%%3){ssU<>3P>$Cr<-*D= zBzxL}b!l)zI#ibqt@dsx6Ln?6nVfD&=eAQX~`>n}~0`@Y+drZ&5VHo6YhyAG~*DUPH(ii6bN>r)?1Io(Ga$z%81`<(u< z_4X4^^2EO$_7a=_d?bO6{)d3|Lzldfbe^5O``%sM>3_K)o!XT4{d-Fw!msS-$zSp7 zQ|zmQ;5XlvU+v?6+j;UiviPh|p!1-3CdPesxcdyp{f-j|Jx!iHPm@Q9)Bb_xjjFnF zRrPa+&`DK&udJC(NmNx0OIKAy3pQ%^62ry_QCvl|2SP89={7*LM0$yX5|pA7t=9H8 z$#fNb!N0u4bHd@D$F~9b{5?J>jNjC^0Qs!qwNrQZu6^hB2ao8|KZtHu+7Yc-Zj`<~ z+Sf(MgC*Y<+q9!_+ek|^5kMZY^*nXRfya(M&g+YsEd$<+0XMPvg z^SDN9|K_)JViw{l4;Iji#2%tOmhb#=N`(P&V-tRGC(%npKzk Dict[str, Any]: + """Run the scrapers and export the data""" + # Create output directory if it doesn't exist + os.makedirs(output_dir, exist_ok=True) + + # Run the scrapers + if isinstance(self.scraper, W3SchoolsScraper): + try: + logger.info(f"Starting scrapers application with output directory: {output_dir}") + course_data = self.scraper.scrape_course() + + # Export full course data to JSON + json_filename = os.path.join(output_dir, "tutorial_course.json") + self.json_exporter.export(course_data, json_filename) + + # Export modules to CSV + modules_filename = os.path.join(output_dir, "tutorial_modules.csv") + self.csv_exporter.export(course_data.modules, modules_filename) + + # Export tutorial titles and URLs to CSV + tutorial_info = [ + {"title": t.title, "url": t.url} for t in course_data.tutorials + ] + tutorials_filename = os.path.join(output_dir, "tutorial_info.csv") + self.csv_exporter.export(tutorial_info, tutorials_filename, ["title", "url"]) + + logger.info("Scraping and exporting completed successfully") + return course_data.dict() + except Exception as e: + logger.error(f"Error in scrapers application: {e}") + raise + else: + logger.error("Unsupported scrapers type") + raise ValueError("Unsupported scrapers type") \ No newline at end of file diff --git a/src/exporters/__init__.py b/src/exporters/__init__.py new file mode 100644 index 0000000..b8037d1 --- /dev/null +++ b/src/exporters/__init__.py @@ -0,0 +1,6 @@ +# Import exporters for easier access +from src.exporters.base import DataExporter +from src.exporters.json_exporter import JsonExporter +from src.exporters.csv_exporter import CsvExporter + +__all__ = ['DataExporter', 'JsonExporter', 'CsvExporter'] \ No newline at end of file diff --git a/src/exporters/__pycache__/__init__.cpython-312.pyc b/src/exporters/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..734ce3bb4a06bfcf7e4228f784d3366c60889ab9 GIT binary patch literal 385 zcmX@j%ge<81i2Ugrhf*~k3k$5V1hC}8vq&88B!Qh7;_kM8KW2(L2RZRrd;MIW-yyM zhb5Oaij|Qeogsx~5n~ivC95XeOOSR=##=lti6x1y6$SZ4C8MCLZ5v)MMPm}$YP;pVRUMkdpV!foq;#9DzThgc!SwM5+Vd}s}+>%07kz8Dc zPyjOi7JGbrVopwc{7MFp_ZfcK>xTkOFV;^?EGo&U)DNgk&PXiE4JgXbN=+^))_3#_ zDJ{t_(gzx=53{LQKR!M)FS8^*Uaz3?7Kcr4eoARhs$CH;&^$&UE*1t7AD9^#8J{v} U-(@hl%V6|~%d(NZh#M#l0D_8dBme*a literal 0 HcmV?d00001 diff --git a/src/exporters/__pycache__/base.cpython-312.pyc b/src/exporters/__pycache__/base.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d29fda792744292eef8efef829562d17190194b6 GIT binary patch literal 1142 zcmY*Y&1(}u6rcS}wr%Q1+f)kTLdCj88lhSWiV!~#!Nv-D*~_rmnWPDuY@OYJ2|e_X zLob526pAM=m3pWr{|GNFJrqYp!IQVx=tU5mx4TL09NyQweeeB#^Y%j~Glax(_y3k( zO9*`jr+>7>=oN+0K?D)WLpEsHlWMXp*A!ckz*juArrDZ=WJFPQq+j4z)6|Zr4#!T* z=sqH98xf7lJ4zBYnv$je0Hl_m6dT zkaHZ{La&rQhieEAGMdPe3tXDBG@kPOa=B73bE8bdhr*_er!lTOHHtAeFpkg&Q-?&# z1fyy|y;1-Jn}2TPo(7Z!Imcn)N;9|IbXOc!TV{Thx?zyZKX}pzeU=NDn;YV;`Z!rewVzjzpEcEEbT8W?OiYI zU4C?sUEWY%4EF#$SAlq*E>%1VK)B9m*kJX7n`{mwMJIXzprwPvF3GKl_)X)73w_fu zp+?~ivJ`eoq_Hs&<3a@RscD+*w9s6S!L`Ot;E02xkPS<>j=DNBGVH9dErY?v^C66D zK52MB_6Ww$8jhDxpTd~_ zkt%7ACDB>0A)PF$+39)W(@EayC70vYl166bQMXGKB3XCX!;Avelw;vCJ&9NePe2K V@xZvauK&^vDf4pvHxeqE=^v;T0z3c! literal 0 HcmV?d00001 diff --git a/src/exporters/__pycache__/csv_exporter.cpython-312.pyc b/src/exporters/__pycache__/csv_exporter.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..239fa98fd10dbfd0e863be3742336cac5e53d568 GIT binary patch literal 2243 zcma)7Uu;uV7(eI!?d|T^+A;Qrc9b%N3am_+E{G&!8%n?hMI}^CQ+rOg*0y(?dq-*0 z8DeYu$j2cT0Z{w#We7<$^PqTpp_hMlJya5KM!JO<@EwSx5^RF(PK9h?J2d zGUPfjtz^`QTIQv+E2Bj;2n2v(YGcLUI)ZB^p)E#q0lW&3d;uT@Ym;JSwKfk!>K|Mf z2#HiWo-{2g^(EsL6??Mz5Tx4Sn2BFE5Kc2e?~7Tn{&T|yu`r3-F6>#W2&*qL<`Tew z=N}OejEKmEL@Z&sg=vt46(loBDN70x5-y}(kRxhd2x+vY*F5XEFL-)Sz7s$!U;tMl z4p529)Rjo4aWF;{;QcuGZR`idaMHBXFGr5Nj% z5p)U%L0-^6Q8eExLK3l@kH-8VksrcR9J@&thYzyLa>}u`D^+9b*3Xj_AyvD6)#e?Y zlf|f*^*zPw|FX2|9REcDNk~S@4Rx|osV*=oSsq89@;Y3V7Nw$i!{wZ9R4&S?#;Vrg zoO~fWaUXcU7l2V^U9FU-R4KqbH97WGT2%h4R!%)2xVZ0G_UrcaOF&~V;y>pEEW@YY z0{$_d7)UD$Uw|)#s>i&r4Rit%<^%{%1IT_Ccb*eZgB;ujtX9Xo9grQP>NDc_on2Lm z+&m7dDXJ`*RE_pA%Y9V+NX@|q^ z2Lhows-%s?d=vs8?mXQ`Wa zoKqypx(cnyaXN%!hzYK;K#UxflG%howf=K)JZvS6ER``&DdeJ(iPH(f+brQABYOGB z398t(%+kUc3bE;8ia=#N>J7hbVq%74F=7qn!zc3bp%}@WAVvzuEi>G6^sN!gAYqfl z!%q7#!z|aRBXtbtsbUKS@4CL#VXtjq!OS3QzURT6x`rja{I}I)4Xt}|E8BKJK4}P7WZ|Ge1Z=GnLICFK!H@mOy{;Fd!*i{O4%>`eY z^LKxKsxMO5pHPnO)o4pw_T|lue&CFt6kS7YZjXK-*#3On)lq-fPd>l4S0Lu z%0^J@u@B)Z>Au-5d#9SG+_V0d7xaS<8~Kh|&*8@pHi7zHgV3_jL2L zdnP#Z#!T;Q+iUas(IwsUctvI#ADNx3RuesY`Z~e)wLN?Lwu?U;dX5Pdog> z&Ub44Tg96Pg8e@6N1x325FB71-xZDWOB;<+cQl$Y&`6r|dNg`wB$lpd)MykL@o1Fr zK2Lb#qoQdMvXgPw!77^>T=~Sic6s9W$PBaT0{BJRd|%oudoS;wkj4+J0LD%=l*u%j z+4o(t%+8)X^?+*#w<&uFZ6KQ&PgM>K4hY4{4>MZLf$*1vx`y*8mbH>`8zo+L-zpb~ zUCxdV*xO6^J4UrZY#lFSjD&a${?^<1c5tp7m!E;U4%$^XM7o&BAAgfGD7%Q6n?Y6UV9T_Cn;$ZrzQzdt0JZ#N(2#7ehQ?4&G)2au2mrvz1qA|a6~J>-~U2uCi7XlU7{5)yFe%_2dSS|KrGdt)Son3dl9-gxGH zZ~VTQA38e1z{b~mf92vLz^^4b+U%VFBI%EH49Ah`PaQ;3FNWprrbM!?`5##RFFnGrz83Fq2lJp-u-9h%Y#~SCs;hMzQq&C|%!0M9pk+gsopvjVqRQsAO zZnoBQ5{*9dmilO+Dwny^7$|jUYmTKjrm70BB$8oYa!SPZ!&MKvsT9Q zm4cJY5$a2poppTe{9=ZbJc})o31>*kzT}cZmU3ZGjpsmF9}$<|+5{hurc;+)Lfw>U zQg6PJx>(7~o3wb5I(d@u+|dfaeYxpbc3+ws^>t{DF zZD0PWXZE*X{>H?*xkdJSrXOk$d$}Hlj_7BzpUmFT2ln)V-BZtR_HBlD?V zFV=y%_2Guw9690 None: + """Export data to a file""" + pass \ No newline at end of file diff --git a/src/exporters/csv_exporter.py b/src/exporters/csv_exporter.py new file mode 100644 index 0000000..57bc8b9 --- /dev/null +++ b/src/exporters/csv_exporter.py @@ -0,0 +1,41 @@ +import csv +import logging +from typing import List, Dict, Any + +from pydantic import BaseModel +from src.exporters.base import DataExporter + +logger = logging.getLogger(__name__) + + +class CsvExporter(DataExporter): + """CSV data exporter""" + + def export(self, data: List[Dict], filename: str, fields: List[str] = None) -> None: + """Export data to CSV file""" + if not data: + self.logger.warning("No data to export") + return + + try: + # Determine fields if not provided + if not fields and data: + if isinstance(data[0], BaseModel): + fields = list(data[0].dict().keys()) + else: + fields = list(data[0].keys()) + + with open(filename, 'w', newline='', encoding='utf-8') as f: + writer = csv.DictWriter(f, fieldnames=fields) + writer.writeheader() + + for item in data: + if isinstance(item, BaseModel): + writer.writerow(item.dict()) + else: + writer.writerow(item) + + self.logger.info(f"Data exported to {filename}") + except Exception as e: + self.logger.error(f"Error exporting data to {filename}: {e}") + raise \ No newline at end of file diff --git a/src/exporters/json_exporter.py b/src/exporters/json_exporter.py new file mode 100644 index 0000000..3cc4667 --- /dev/null +++ b/src/exporters/json_exporter.py @@ -0,0 +1,25 @@ +import json +import logging +from typing import Any + +from pydantic import BaseModel +from src.exporters.base import DataExporter + +logger = logging.getLogger(__name__) + + +class JsonExporter(DataExporter): + """JSON data exporter""" + + def export(self, data: Any, filename: str) -> None: + """Export data to JSON file""" + try: + with open(filename, 'w', encoding='utf-8') as f: + if isinstance(data, BaseModel): + json.dump(data.dict(), f, indent=4, ensure_ascii=False) + else: + json.dump(data, f, indent=4, ensure_ascii=False) + self.logger.info(f"Data exported to {filename}") + except Exception as e: + self.logger.error(f"Error exporting data to {filename}: {e}") + raise \ No newline at end of file diff --git a/src/models/__init__.py b/src/models/__init__.py new file mode 100644 index 0000000..d24ed5d --- /dev/null +++ b/src/models/__init__.py @@ -0,0 +1,4 @@ +# Import models for easier access +from src.models.schema import TutorialLink, CodeExample, TutorialContent, TutorialCourse + +__all__ = ['TutorialLink', 'CodeExample', 'TutorialContent', 'TutorialCourse'] \ No newline at end of file diff --git a/src/models/__pycache__/__init__.cpython-312.pyc b/src/models/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5c4c05b2fb3d236b601b5ea515e4cc4872f62e34 GIT binary patch literal 312 zcmX@j%ge<81RE~=O+N*sAA>kBzyxJ{Rsk}mGo&!2Fy=7iGDb1xGDR`vGDk7zvP7{k zGNc2=7coY$Rx)WazXWN~WVyu?Qd*KOw5T}MPm}GIU~y5hUM^5mPO)Bbaz<)yVi7aY;35_f!3rYSfW$5K`1r(} zocQ>a44;8qhF>=Np~b01#rlbfMI{-P`T>>68Hq)?0Y&*)smUe9`i`DpoAiN(>q89J zkB`sH%PfhH*DI*J#bE;!EX_%^E8+nf#t6j40zl#eGb1D8bB2h^3=xmG{2JMdKmi5- DOUYSX literal 0 HcmV?d00001 diff --git a/src/models/__pycache__/schema.cpython-312.pyc b/src/models/__pycache__/schema.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5028f5afa6a944c25871048dd0a24378f8b48dd0 GIT binary patch literal 2152 zcma)7&2QX96d$iY*880_1=^}5hDM}DQMMFBp;Snv6cW^KD$yeF#hTia#I5aJ#@;9! z6)7S?N^dKH)F2LUMdiTXK`#y4!*+yJRh+ni5-vzcyf?esY(gX$$|I`K7T+ylS3oSZ~;K#d_ZFVQTZ<`7ztXb#Z)5L#>%?BZ|e%+`ca|ny@Q%pM^qyFJPfBa!WJ}e45s|hYkj-9~{|!36Q&l z5l8WflerGbIx5qc?q|+}MQSQ)EzQo=K~Ce;hGGT>^$y()Z% zg-JE>7Fk568!cV{2U1|elM0A0$Rq7cw@_aDpqneM&+umkI}R@0%V6GLIzQt;@tEPu zqDf7Y<!rZ096TdOl0UPrUK`O^Aq?*-g@aJng2 z_NRLgQzRynULcOavdlaRZvvxqEQD`3IhJQyAIl<^A*|qQ_Y_cJ`Q|#g*Hej8Y#DY= zR0h1eSdUW{r^D1ko_Rgks?QHIu>ob{MexK+AVjvmOO&vZZok?|P2^&>oVv(cFVp`n z-ZZ#WxVAqAahKdy`0=zKB7vuyXxq02VLwepxpfLYUq}Zt1!l&;_PKIf`H6S*;E_WyG z)hq4SHVa#06CKU&j-One-B{jK?|jzLPCn7g8?BCh^pA|Hk8Z2PI3~3oyV11=*V8p< z;&uqo|6(^Vy3bw7ac1o0H*gvF{ev-Rvr}M2I1#1!%rN6yCa}7^+mTZcR>T4%{4`l_ z2^JS6>lH&(7waV@7N>&cZ;7FZmm3#D%mC}V#U3A@n3EG9zmnlI$j)DO`k_F5#rlbf zMI{-P`T>>68Hq)?0Y&*)smUe9`i`CE8+$k#|Xs5VnE^pGb1D8QwEK@48{+*#V<%|U*OVdWG~_bN&x^^Xji2G literal 0 HcmV?d00001 diff --git a/src/scrapers/__pycache__/base.cpython-312.pyc b/src/scrapers/__pycache__/base.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b712a7cba0f96a2aedff6c282cb8d99db5ae2dc6 GIT binary patch literal 3430 zcma)8O>7&-6`uX$pGZ*_UD4KG){b0hA@EH@jR>He8?! z?3;OS-u%AreKUVbBw`4@t;T;AejP^WZ%he3sa@Iq0xGM>Kn7=_94mQ?EAlzMDC7i= z>4GH|rJPg@aq5?4lJZMsrcmCRwp!SFVdgJi@4OD43*Eg0;V+1vMk|H2j43 zwRYdZpsiElk{f{e(0WJEFlL}*(NR5>N~oGCL3Plc(AmuR;(@3=(M-6D1u zZNoE{sx)%5?3#8-vlNbYU7ee|HDzdJ7ZXsW+t?-5+Non>nxngB5i5>7E*~2!X?s-* z{~TNU^dfc~Z2=r%c*$#|p}b9snydRO^CcX;_wCl9ScL=1aR$oq2A30zxFKNC5V3^C z!_b-+4e7p=3mG9CF7)`__RBnPgzt;Fs1bo)p?$rgV2$A}BL;TAEuIej zdi(6X(HWMQzWYZItEkS^kqR~ctMkj8!vji~wH-%<>ZlMPFmQx2SS)z%jqgSShk}RZ zK=VsC9_XI{a$(f&K<|`=J)e&46Z9J)Ko!gu30kU15oT)dOxrcnvb5~!%n5nyeY0fP zOO8A98 zT&y|(7XTj(?^P^&VZkgd(C7koZ$KRr8c|h-Fjb{dRrNvw)ev(8lnPXIu$Au&?yzH$ zW%>KF+4mqePFB;1yI9TMs_KgxDc&M>0qd@low_zxacz=yh@K51n`Lp$lp!fp)hwB= zs@75+bYuc!3TAL-K-@#EL-LCFt3<1R3g^UV+ei^ zO$e;3$lYrzw3&kS488y{cey%O5CdzcECk8dF?mQV>_xoOU~&N>IOKK(c7r#B1z@}1 za)z|PJqfkkaXdmLADD~<{Tp<~N*T$T|5aIJKxPt85V_c52~8*DasTW@`~vaiFF|Xe8JK4bKMo(B1(JRmuh=ikCKo1&FZd zQK@KGO0FUjcCV0LX6p7fsxpdq@j{h`HJ`^F797Y2nJ_jb2SC*N_k;T7RAf#L0dWug zy|=&Fd$iGebgOq{CESW6A0{6pn~~v0WOyyUZv5VUY;V4CVLS4Z7a`RDMyof~8W^NQ zldYknkFLCkO8v2w?iX>C8eY$A_x{))An_pak-3)Mjwoz6rWMvkwijwuiqzQpI1IZWcxIvx&XTsJG=b=8KJwv zFN7-Go~&Hrme8{B0b1geaBbiUcIB&c(>G+@F1e5ra-P^l$f@^k->603#jd^xL@Yla zhRFcOVfFy9D{d`$nGm=U^MON+KP%5DF_H#9Dw-w81`m(|FgWcYnh94W*Z`RjEyG2uws%t- z*az}g8;`?i&W9lGp&c(o5C-j41W!M{HhdXQ8E8rd`q2Ey?vM4%W4P6Q_BaQf z2s_^3=Jbey##xwP0F@0;OYb|({SA|>AInfU$PkJqyc|}z8Ks;20IW2oszuwVSnT$W ztLmMK=Dij{3#+PO>rfGZvIx832zw5D$RMMv#;A&%WrFRCu*VU(z{Ghb7+Ls~#@;f7 z36@FD9T4}?U&PEeqA2~8TTAUAR&I=aHu35Bu2H3kN-tpvN(F6R zCybK3#nX^mEkic>oA5U4Wx#=e`ZEDr`~2PuBxsrQ6Pb!@S{aYoJ@%(v@Io>5OLi%5 zE>Q8>%)2+qK{g3HY%c@7gLvhHXyhF~2p7mT@Bf#bL@QTNyA&99OCB}#sU zl&{bT1d=;=FWf|_21>PJ2Ohrt;O$n|)VGqr@jDR|8(2vxRDdPah%8?Y8KA+0Ir?_6p@xqy_ zTxLEkC_ZE8m0VU5vXbK6?N}h9kkDAra+}^zW%Of^l0czkVrJeHv+y3?EYQ3~uqNpu zl{E46`<|GMw?dyyunSBFOit3g{e3#-P2pG#Tc7O_Xu+E_>npfm z#0P8olV;ux^_C)a)f5X%Q4z1=zjS0OF`LV!MSb`AeR_pW<_OyuWhGrAqT&!Gj!5wZ zl2)v|kmi;Wy4cmtVjaK7laT$?1d3rQSR{1_vzxR`eE_N>TZ|(#QL;&<;%0+HHbbki z;t~}xU&wdNO47VI9*r(8E{-l95jBoS6S)i=mQ`GUQ&X6DJe5sJ@i_6qQp5*Y#H!Gu zkWTLQD9kh`3M%i8cs!BjL@^#0QI%OpH@-O)eM=OG80BDxvrEx8mlCra$-GH&b3#HA zqo>cQhaDA3A}VUyB1U)lnO`CSSSsJq5SuQ`QG+)>42uJh{p|)-3yv0iv_P_nhO~gh4xcLV7#PJWCF!OC zGB)w1dpc#oJVO;MvU#o{SzKL9yxBO50xi?zrcBQn#%+*5$u~}{V3n#4Ovhewmt6q33DJkHE}j`$yC- zECoik%z2(3#g>HUt|s6NrM)N31^0A7^Pb)%Gxr%oUIsTN>ed1c+6u}t4HL}* zqRffWh*_~pDG6Z30_GHP5(Esz2|5ev7SCk`g-NEee4IxR{b=2>>#s z*tq$5A#5th^<1SlTI=5bmDMub_BCZ`ZLd41j^28J^7oXOZqg3Cl0L|u0y&hn zYI45<^LnPqSwKafZ*HAnZZxd7Cp9xGLs7FP-U3G0eDz(^1LGu}UehlC-~vtT zADU{xAv*vF1ONgjZ!frbMt07*_G|>2ykmwk4C@L-EWESe%C_;Ye~KD>R>37R&oOpf z>tEdGeUHJ@6UIJ+#@_VQyarXl&HD--*-c)R-A#Afh)&42pGQ&f%HFw_CK78g{swU9 zRpAgl%bo;q7?8ax9D1ZyV^Fq&3$@FP?71Jjrvo{_S12Dg;LGsktnOAw7tGE3W)F|1 z1&(Crxf$Wm?BTrkLXN$N=)}I7TgdWx>p+G}W%GXM)`K5?AOt@7ke~%fEY=eMZ;Eq{ zyTXB&Ow9vs%`Zu_x$N20%&cNn-L7KOx&VfLlvevKPys+>(p+|C0a#FITqf_w1qn=) zure)WFQ^zrFfJtfAd6TDi*>Y8#cp^?4^EEjOhM3+1vrW$!bMyv%94JZa}cv3oM_WP zm+Z%$LCjF~$pOp|X$iWch;J8E)&G$Q^eP?|!{dP30ELpujp9aG8Gf6L;R@qO>r(le zPUjK;xz61NIf|n#4K^FA9mlDN$|AZp9f^%XL*%dlwZ_33|IJ69iOPFPaUp(R16k?kf$ARl?&%&x6t9%bu#gzwGa?`iIK?p&kEl>Gb!DR-g=buU=odzOh(o zj~3kzqQ{p~pjt)+8q?sj%PyLoAAy3#vVZW*g}vCGUO zcSqIDmfh?xyJ{VMwbp&B@s)VBb-3I*TxlHvVDI+=uzP%UAJsKj@1%PAZojeqMrmZC z(tWDLbksuOqT_+9yVUn@)xMX?eJ_Cz>6@qp_g8~M<>1g}TP65Hak9qlzvKJZw`JR5 zkFL|7(!cZk*0X*6v)R(6e=oiLPU+<3;<+z&0a9SXru^Y^cnLu*lzh)KwFZZ$V4{dBc zhKmH6gU_RpEzh86#KR|GgSTD>$6;>fw0WxmL5va|4};ysS8Be%hl@8Cm#=(q zedEZTqaPpL9Q%CW+qIGCC$HUoZR=cRWMY|F3*K&DZ{KM9Xy1SOBXuhk>Zv;^h%R$0 zxzgZRrER?Edf;lS4IZuzzEmE3sXBO~Jb0oqI8i*ie7Wo%c;ss@`ZR5S(sFUXsAg_g)QLH8+S6eA5+crs`<=@u9;+$=#m`9-*@kL|AGH(5~Rtd#$5Ar zxVA`*n-}1dzIzBp=wCE!Lgl(~7c;oPJE=hruL6z02X2Q=8DR|EPt9Qe zpP~IfhetbDZS#ct>-t;jEocp7pIi0Q%A3 zpwlDm#NNN_#ySXY+lpa;dbSx~-%jC1%x$>Ma*35y|p4 zHT-1ry^TjG4dK{SR-@K#UNAzJNt$>>w#DVQ&w1|R@@X1pJ|Zn{cs!<#RDGI4jJG(27k9p7P208V%I zRy#(^9iyAlC)e&?t8`2hy$^gnUj({KJug=Rr%UeB7#sFf!-vb^!&{@3@adxG3vIpS zUtb&ExOgY_actxKmSt=5H)nr+c5A#8p4f4pdKB)i zh7Xm)hc@|7X7A2c!bgke9{9o#1XkITW%lHD>a)Xeu84bu=NsLr@%oNDTNyg!-3N zH%`z4s2Nto70CYfKJ|c({4Y&gyEX>u6cn4n*I3luE!Li`V4Z?uJG7lHkG=jF>-E7Q zt8;6rPC>CPs>P?*A7iV2(PXy1Y}$l5SZ*EB%I#B+)pninTf>_$5sIyg+XLI;_Rz22 zeT>ce{)5)8wQGN+pipJ0@)!w{w}C^&j^+yHqu8V+v};W|4IwC&Y4Jtv4Xy>Acy%2o z;wU~E6ZGtg+7E{yq(vB>6*8PATy(UWaM7d{2Y|qN6&gq!N4}34O6o49aizYbF( requests.Session: + """Create a requests session with headers and retry logic""" + session = requests.Session() + session.headers.update({"User-Agent": self.user_agent}) + + # Configure retry strategy + retry_strategy = Retry( + total=3, + backoff_factor=1, + status_forcelist=[429, 500, 502, 503, 504], + allowed_methods=["GET"] + ) + adapter = HTTPAdapter(max_retries=retry_strategy) + session.mount("http://", adapter) + session.mount("https://", adapter) + + return session + + def get_page_content(self, url: str) -> Optional[str]: + """Get HTML content from a URL""" + try: + self.logger.info(f"Fetching {url}") + response = self.session.get(url, timeout=30) + response.raise_for_status() + return response.text + except requests.exceptions.RequestException as e: + self.logger.error(f"Error fetching {url}: {e}") + return None + + @abstractmethod + def extract_data(self, html_content: str, url: str) -> Any: + """Extract data from HTML content""" + pass \ No newline at end of file diff --git a/src/scrapers/w3schools.py b/src/scrapers/w3schools.py new file mode 100644 index 0000000..d986b89 --- /dev/null +++ b/src/scrapers/w3schools.py @@ -0,0 +1,144 @@ +import time +import logging +from typing import List, Dict, Any + +from bs4 import BeautifulSoup + +from src.scrapers.base import WebScraper +from src.models.schema import TutorialLink, CodeExample, TutorialContent, TutorialCourse + +logger = logging.getLogger(__name__) + + +class W3SchoolsScraper(WebScraper): + """Scraper for W3Schools tutorials""" + + def __init__(self, start_url: str, delay: float = 1.0): + base_url = "https://www.w3schools.com" + super().__init__(base_url) + self.start_url = start_url + self.delay = delay # Delay between requests to avoid overloading the server + + def extract_sidebar_menu(self, html_content: str) -> List[TutorialLink]: + """Extract sidebar menu items""" + soup = BeautifulSoup(html_content, 'html.parser') + sidebar_items = [] + + sidebar = soup.select_one('#sidenav') + if sidebar: + links = sidebar.find_all('a') + for link in links: + href = link.get('href') + if href and '.asp' in href: + full_url = href if href.startswith('http') else f"{self.base_url}/nodejs/{href}" + sidebar_items.append(TutorialLink( + title=link.text.strip(), + url=full_url + )) + + return sidebar_items + + def extract_tutorial_content(self, html_content: str, url: str) -> TutorialContent: + """Extract tutorial content""" + soup = BeautifulSoup(html_content, 'html.parser') + + # Extract title + title_element = soup.select_one('h1.learnpage-h1') + title = title_element.text.strip() if title_element else "No Title Found" + + # Extract main content + main_content = soup.select_one('#main') + content = main_content.text.strip() if main_content else "No Content Found" + + # Extract code examples + code_examples = [] + code_blocks = soup.select('.w3-example .w3-code') + for code_block in code_blocks: + language = "javascript" # Default language + if "pythonHigh" in code_block.get('class', []): + language = "python" + elif "sqlHigh" in code_block.get('class', []): + language = "sql" + + code_examples.append(CodeExample( + language=language, + code=code_block.text.strip() + )) + + # Find next tutorial link + next_link_element = soup.select_one('.w3-right.w3-btn') + next_link = None + if next_link_element and next_link_element.get('href'): + href = next_link_element.get('href') + next_link = href if href.startswith('http') else f"{self.base_url}/nodejs/{href}" + + return TutorialContent( + title=title, + url=url, + content=content, + code_examples=code_examples, + next_link=next_link + ) + + def extract_data(self, html_content: str, url: str) -> TutorialContent: + """Implementation of abstract method to extract data""" + return self.extract_tutorial_content(html_content, url) + + def extract_metadata(self, html_content: str) -> Dict[str, Any]: + """Extract metadata from the course pages""" + soup = BeautifulSoup(html_content, 'html.parser') + metadata = {} + + # Extract meta tags + meta_tags = soup.find_all('meta') + for tag in meta_tags: + if tag.get('name') and tag.get('content'): + metadata[tag.get('name')] = tag.get('content') + + # Extract course information + course_info = soup.select_one('.w3-panel.w3-info') + if course_info: + metadata['course_info'] = course_info.text.strip() + + return metadata + + def scrape_course(self) -> TutorialCourse: + """Scrape the entire course""" + logger.info(f"Starting to scrape: {self.start_url}") + + # Get the main page content + main_page_html = self.get_page_content(self.start_url) + if not main_page_html: + raise ValueError("Failed to fetch the starting page") + + # Extract sidebar menu + sidebar_items = self.extract_sidebar_menu(main_page_html) + logger.info(f"Found {len(sidebar_items)} tutorial pages in the sidebar") + + # Extract metadata + metadata = self.extract_metadata(main_page_html) + + # Create course data structure + course_data = TutorialCourse( + title="W3Schools Tutorial", + source_url=self.start_url, + modules=sidebar_items, + tutorials=[], + metadata=metadata + ) + + # Extract content from each tutorial page + for item in sidebar_items: + logger.info(f"Scraping: {item.title} - {item.url}") + + page_html = self.get_page_content(item.url) + if page_html: + tutorial_data = self.extract_tutorial_content(page_html, item.url) + course_data.tutorials.append(tutorial_data) + + # Be nice to the server + time.sleep(self.delay) + else: + logger.warning(f"Skipping {item.url} due to fetch error") + + return course_data diff --git a/uv.lock b/uv.lock deleted file mode 100644 index 5558fef..0000000 --- a/uv.lock +++ /dev/null @@ -1,640 +0,0 @@ -version = 1 -revision = 1 -requires-python = ">=3.12" -resolution-markers = [ - "python_full_version >= '3.12.4'", - "python_full_version < '3.12.4'", -] - -[[package]] -name = "aitutor" -version = "0.1.0" -source = { virtual = "." } -dependencies = [ - { name = "langchain" }, - { name = "langgraph" }, - { name = "langsmith" }, -] - -[package.metadata] -requires-dist = [ - { name = "langchain", specifier = ">=0.3.21" }, - { name = "langgraph", specifier = ">=0.3.18" }, - { name = "langsmith", specifier = ">=0.3.18" }, -] - -[[package]] -name = "annotated-types" -version = "0.7.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643 }, -] - -[[package]] -name = "anyio" -version = "4.9.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "idna" }, - { name = "sniffio" }, - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/95/7d/4c1bd541d4dffa1b52bd83fb8527089e097a106fc90b467a7313b105f840/anyio-4.9.0.tar.gz", hash = "sha256:673c0c244e15788651a4ff38710fea9675823028a6f08a5eda409e0c9840a028", size = 190949 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/a1/ee/48ca1a7c89ffec8b6a0c5d02b89c305671d5ffd8d3c94acf8b8c408575bb/anyio-4.9.0-py3-none-any.whl", hash = "sha256:9f76d541cad6e36af7beb62e978876f3b41e3e04f2c1fbf0884604c0a9c4d93c", size = 100916 }, -] - -[[package]] -name = "certifi" -version = "2025.1.31" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/1c/ab/c9f1e32b7b1bf505bf26f0ef697775960db7932abeb7b516de930ba2705f/certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651", size = 167577 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/38/fc/bce832fd4fd99766c04d1ee0eead6b0ec6486fb100ae5e74c1d91292b982/certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe", size = 166393 }, -] - -[[package]] -name = "cffi" -version = "1.17.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "pycparser" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/fc/97/c783634659c2920c3fc70419e3af40972dbaf758daa229a7d6ea6135c90d/cffi-1.17.1.tar.gz", hash = "sha256:1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824", size = 516621 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/5a/84/e94227139ee5fb4d600a7a4927f322e1d4aea6fdc50bd3fca8493caba23f/cffi-1.17.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:805b4371bf7197c329fcb3ead37e710d1bca9da5d583f5073b799d5c5bd1eee4", size = 183178 }, - { url = "https://files.pythonhosted.org/packages/da/ee/fb72c2b48656111c4ef27f0f91da355e130a923473bf5ee75c5643d00cca/cffi-1.17.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:733e99bc2df47476e3848417c5a4540522f234dfd4ef3ab7fafdf555b082ec0c", size = 178840 }, - { url = "https://files.pythonhosted.org/packages/cc/b6/db007700f67d151abadf508cbfd6a1884f57eab90b1bb985c4c8c02b0f28/cffi-1.17.1-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1257bdabf294dceb59f5e70c64a3e2f462c30c7ad68092d01bbbfb1c16b1ba36", size = 454803 }, - { url = "https://files.pythonhosted.org/packages/1a/df/f8d151540d8c200eb1c6fba8cd0dfd40904f1b0682ea705c36e6c2e97ab3/cffi-1.17.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da95af8214998d77a98cc14e3a3bd00aa191526343078b530ceb0bd710fb48a5", size = 478850 }, - { url = "https://files.pythonhosted.org/packages/28/c0/b31116332a547fd2677ae5b78a2ef662dfc8023d67f41b2a83f7c2aa78b1/cffi-1.17.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d63afe322132c194cf832bfec0dc69a99fb9bb6bbd550f161a49e9e855cc78ff", size = 485729 }, - { url = "https://files.pythonhosted.org/packages/91/2b/9a1ddfa5c7f13cab007a2c9cc295b70fbbda7cb10a286aa6810338e60ea1/cffi-1.17.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f79fc4fc25f1c8698ff97788206bb3c2598949bfe0fef03d299eb1b5356ada99", size = 471256 }, - { url = "https://files.pythonhosted.org/packages/b2/d5/da47df7004cb17e4955df6a43d14b3b4ae77737dff8bf7f8f333196717bf/cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b62ce867176a75d03a665bad002af8e6d54644fad99a3c70905c543130e39d93", size = 479424 }, - { url = "https://files.pythonhosted.org/packages/0b/ac/2a28bcf513e93a219c8a4e8e125534f4f6db03e3179ba1c45e949b76212c/cffi-1.17.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:386c8bf53c502fff58903061338ce4f4950cbdcb23e2902d86c0f722b786bbe3", size = 484568 }, - { url = "https://files.pythonhosted.org/packages/d4/38/ca8a4f639065f14ae0f1d9751e70447a261f1a30fa7547a828ae08142465/cffi-1.17.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:4ceb10419a9adf4460ea14cfd6bc43d08701f0835e979bf821052f1805850fe8", size = 488736 }, - { url = "https://files.pythonhosted.org/packages/86/c5/28b2d6f799ec0bdecf44dced2ec5ed43e0eb63097b0f58c293583b406582/cffi-1.17.1-cp312-cp312-win32.whl", hash = "sha256:a08d7e755f8ed21095a310a693525137cfe756ce62d066e53f502a83dc550f65", size = 172448 }, - { url = "https://files.pythonhosted.org/packages/50/b9/db34c4755a7bd1cb2d1603ac3863f22bcecbd1ba29e5ee841a4bc510b294/cffi-1.17.1-cp312-cp312-win_amd64.whl", hash = "sha256:51392eae71afec0d0c8fb1a53b204dbb3bcabcb3c9b807eedf3e1e6ccf2de903", size = 181976 }, - { url = "https://files.pythonhosted.org/packages/8d/f8/dd6c246b148639254dad4d6803eb6a54e8c85c6e11ec9df2cffa87571dbe/cffi-1.17.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f3a2b4222ce6b60e2e8b337bb9596923045681d71e5a082783484d845390938e", size = 182989 }, - { url = "https://files.pythonhosted.org/packages/8b/f1/672d303ddf17c24fc83afd712316fda78dc6fce1cd53011b839483e1ecc8/cffi-1.17.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0984a4925a435b1da406122d4d7968dd861c1385afe3b45ba82b750f229811e2", size = 178802 }, - { url = "https://files.pythonhosted.org/packages/0e/2d/eab2e858a91fdff70533cab61dcff4a1f55ec60425832ddfdc9cd36bc8af/cffi-1.17.1-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d01b12eeeb4427d3110de311e1774046ad344f5b1a7403101878976ecd7a10f3", size = 454792 }, - { url = "https://files.pythonhosted.org/packages/75/b2/fbaec7c4455c604e29388d55599b99ebcc250a60050610fadde58932b7ee/cffi-1.17.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:706510fe141c86a69c8ddc029c7910003a17353970cff3b904ff0686a5927683", size = 478893 }, - { url = "https://files.pythonhosted.org/packages/4f/b7/6e4a2162178bf1935c336d4da8a9352cccab4d3a5d7914065490f08c0690/cffi-1.17.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de55b766c7aa2e2a3092c51e0483d700341182f08e67c63630d5b6f200bb28e5", size = 485810 }, - { url = "https://files.pythonhosted.org/packages/c7/8a/1d0e4a9c26e54746dc08c2c6c037889124d4f59dffd853a659fa545f1b40/cffi-1.17.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c59d6e989d07460165cc5ad3c61f9fd8f1b4796eacbd81cee78957842b834af4", size = 471200 }, - { url = "https://files.pythonhosted.org/packages/26/9f/1aab65a6c0db35f43c4d1b4f580e8df53914310afc10ae0397d29d697af4/cffi-1.17.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd398dbc6773384a17fe0d3e7eeb8d1a21c2200473ee6806bb5e6a8e62bb73dd", size = 479447 }, - { url = "https://files.pythonhosted.org/packages/5f/e4/fb8b3dd8dc0e98edf1135ff067ae070bb32ef9d509d6cb0f538cd6f7483f/cffi-1.17.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:3edc8d958eb099c634dace3c7e16560ae474aa3803a5df240542b305d14e14ed", size = 484358 }, - { url = "https://files.pythonhosted.org/packages/f1/47/d7145bf2dc04684935d57d67dff9d6d795b2ba2796806bb109864be3a151/cffi-1.17.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:72e72408cad3d5419375fc87d289076ee319835bdfa2caad331e377589aebba9", size = 488469 }, - { url = "https://files.pythonhosted.org/packages/bf/ee/f94057fa6426481d663b88637a9a10e859e492c73d0384514a17d78ee205/cffi-1.17.1-cp313-cp313-win32.whl", hash = "sha256:e03eab0a8677fa80d646b5ddece1cbeaf556c313dcfac435ba11f107ba117b5d", size = 172475 }, - { url = "https://files.pythonhosted.org/packages/7c/fc/6a8cb64e5f0324877d503c854da15d76c1e50eb722e320b15345c4d0c6de/cffi-1.17.1-cp313-cp313-win_amd64.whl", hash = "sha256:f6a16c31041f09ead72d69f583767292f750d24913dadacf5756b966aacb3f1a", size = 182009 }, -] - -[[package]] -name = "charset-normalizer" -version = "3.4.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/16/b0/572805e227f01586461c80e0fd25d65a2115599cc9dad142fee4b747c357/charset_normalizer-3.4.1.tar.gz", hash = "sha256:44251f18cd68a75b56585dd00dae26183e102cd5e0f9f1466e6df5da2ed64ea3", size = 123188 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/0a/9a/dd1e1cdceb841925b7798369a09279bd1cf183cef0f9ddf15a3a6502ee45/charset_normalizer-3.4.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:73d94b58ec7fecbc7366247d3b0b10a21681004153238750bb67bd9012414545", size = 196105 }, - { url = "https://files.pythonhosted.org/packages/d3/8c/90bfabf8c4809ecb648f39794cf2a84ff2e7d2a6cf159fe68d9a26160467/charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dad3e487649f498dd991eeb901125411559b22e8d7ab25d3aeb1af367df5efd7", size = 140404 }, - { url = "https://files.pythonhosted.org/packages/ad/8f/e410d57c721945ea3b4f1a04b74f70ce8fa800d393d72899f0a40526401f/charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c30197aa96e8eed02200a83fba2657b4c3acd0f0aa4bdc9f6c1af8e8962e0757", size = 150423 }, - { url = "https://files.pythonhosted.org/packages/f0/b8/e6825e25deb691ff98cf5c9072ee0605dc2acfca98af70c2d1b1bc75190d/charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2369eea1ee4a7610a860d88f268eb39b95cb588acd7235e02fd5a5601773d4fa", size = 143184 }, - { url = "https://files.pythonhosted.org/packages/3e/a2/513f6cbe752421f16d969e32f3583762bfd583848b763913ddab8d9bfd4f/charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc2722592d8998c870fa4e290c2eec2c1569b87fe58618e67d38b4665dfa680d", size = 145268 }, - { url = "https://files.pythonhosted.org/packages/74/94/8a5277664f27c3c438546f3eb53b33f5b19568eb7424736bdc440a88a31f/charset_normalizer-3.4.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffc9202a29ab3920fa812879e95a9e78b2465fd10be7fcbd042899695d75e616", size = 147601 }, - { url = "https://files.pythonhosted.org/packages/7c/5f/6d352c51ee763623a98e31194823518e09bfa48be2a7e8383cf691bbb3d0/charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:804a4d582ba6e5b747c625bf1255e6b1507465494a40a2130978bda7b932c90b", size = 141098 }, - { url = "https://files.pythonhosted.org/packages/78/d4/f5704cb629ba5ab16d1d3d741396aec6dc3ca2b67757c45b0599bb010478/charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:0f55e69f030f7163dffe9fd0752b32f070566451afe180f99dbeeb81f511ad8d", size = 149520 }, - { url = "https://files.pythonhosted.org/packages/c5/96/64120b1d02b81785f222b976c0fb79a35875457fa9bb40827678e54d1bc8/charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c4c3e6da02df6fa1410a7680bd3f63d4f710232d3139089536310d027950696a", size = 152852 }, - { url = "https://files.pythonhosted.org/packages/84/c9/98e3732278a99f47d487fd3468bc60b882920cef29d1fa6ca460a1fdf4e6/charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:5df196eb874dae23dcfb968c83d4f8fdccb333330fe1fc278ac5ceeb101003a9", size = 150488 }, - { url = "https://files.pythonhosted.org/packages/13/0e/9c8d4cb99c98c1007cc11eda969ebfe837bbbd0acdb4736d228ccaabcd22/charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e358e64305fe12299a08e08978f51fc21fac060dcfcddd95453eabe5b93ed0e1", size = 146192 }, - { url = "https://files.pythonhosted.org/packages/b2/21/2b6b5b860781a0b49427309cb8670785aa543fb2178de875b87b9cc97746/charset_normalizer-3.4.1-cp312-cp312-win32.whl", hash = "sha256:9b23ca7ef998bc739bf6ffc077c2116917eabcc901f88da1b9856b210ef63f35", size = 95550 }, - { url = "https://files.pythonhosted.org/packages/21/5b/1b390b03b1d16c7e382b561c5329f83cc06623916aab983e8ab9239c7d5c/charset_normalizer-3.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:6ff8a4a60c227ad87030d76e99cd1698345d4491638dfa6673027c48b3cd395f", size = 102785 }, - { url = "https://files.pythonhosted.org/packages/38/94/ce8e6f63d18049672c76d07d119304e1e2d7c6098f0841b51c666e9f44a0/charset_normalizer-3.4.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:aabfa34badd18f1da5ec1bc2715cadc8dca465868a4e73a0173466b688f29dda", size = 195698 }, - { url = "https://files.pythonhosted.org/packages/24/2e/dfdd9770664aae179a96561cc6952ff08f9a8cd09a908f259a9dfa063568/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22e14b5d70560b8dd51ec22863f370d1e595ac3d024cb8ad7d308b4cd95f8313", size = 140162 }, - { url = "https://files.pythonhosted.org/packages/24/4e/f646b9093cff8fc86f2d60af2de4dc17c759de9d554f130b140ea4738ca6/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8436c508b408b82d87dc5f62496973a1805cd46727c34440b0d29d8a2f50a6c9", size = 150263 }, - { url = "https://files.pythonhosted.org/packages/5e/67/2937f8d548c3ef6e2f9aab0f6e21001056f692d43282b165e7c56023e6dd/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2d074908e1aecee37a7635990b2c6d504cd4766c7bc9fc86d63f9c09af3fa11b", size = 142966 }, - { url = "https://files.pythonhosted.org/packages/52/ed/b7f4f07de100bdb95c1756d3a4d17b90c1a3c53715c1a476f8738058e0fa/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:955f8851919303c92343d2f66165294848d57e9bba6cf6e3625485a70a038d11", size = 144992 }, - { url = "https://files.pythonhosted.org/packages/96/2c/d49710a6dbcd3776265f4c923bb73ebe83933dfbaa841c5da850fe0fd20b/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:44ecbf16649486d4aebafeaa7ec4c9fed8b88101f4dd612dcaf65d5e815f837f", size = 147162 }, - { url = "https://files.pythonhosted.org/packages/b4/41/35ff1f9a6bd380303dea55e44c4933b4cc3c4850988927d4082ada230273/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0924e81d3d5e70f8126529951dac65c1010cdf117bb75eb02dd12339b57749dd", size = 140972 }, - { url = "https://files.pythonhosted.org/packages/fb/43/c6a0b685fe6910d08ba971f62cd9c3e862a85770395ba5d9cad4fede33ab/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:2967f74ad52c3b98de4c3b32e1a44e32975e008a9cd2a8cc8966d6a5218c5cb2", size = 149095 }, - { url = "https://files.pythonhosted.org/packages/4c/ff/a9a504662452e2d2878512115638966e75633519ec11f25fca3d2049a94a/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:c75cb2a3e389853835e84a2d8fb2b81a10645b503eca9bcb98df6b5a43eb8886", size = 152668 }, - { url = "https://files.pythonhosted.org/packages/6c/71/189996b6d9a4b932564701628af5cee6716733e9165af1d5e1b285c530ed/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:09b26ae6b1abf0d27570633b2b078a2a20419c99d66fb2823173d73f188ce601", size = 150073 }, - { url = "https://files.pythonhosted.org/packages/e4/93/946a86ce20790e11312c87c75ba68d5f6ad2208cfb52b2d6a2c32840d922/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:fa88b843d6e211393a37219e6a1c1df99d35e8fd90446f1118f4216e307e48cd", size = 145732 }, - { url = "https://files.pythonhosted.org/packages/cd/e5/131d2fb1b0dddafc37be4f3a2fa79aa4c037368be9423061dccadfd90091/charset_normalizer-3.4.1-cp313-cp313-win32.whl", hash = "sha256:eb8178fe3dba6450a3e024e95ac49ed3400e506fd4e9e5c32d30adda88cbd407", size = 95391 }, - { url = "https://files.pythonhosted.org/packages/27/f2/4f9a69cc7712b9b5ad8fdb87039fd89abba997ad5cbe690d1835d40405b0/charset_normalizer-3.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:b1ac5992a838106edb89654e0aebfc24f5848ae2547d22c2c3f66454daa11971", size = 102702 }, - { url = "https://files.pythonhosted.org/packages/0e/f6/65ecc6878a89bb1c23a086ea335ad4bf21a588990c3f535a227b9eea9108/charset_normalizer-3.4.1-py3-none-any.whl", hash = "sha256:d98b1668f06378c6dbefec3b92299716b931cd4e6061f3c875a71ced1780ab85", size = 49767 }, -] - -[[package]] -name = "greenlet" -version = "3.1.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/2f/ff/df5fede753cc10f6a5be0931204ea30c35fa2f2ea7a35b25bdaf4fe40e46/greenlet-3.1.1.tar.gz", hash = "sha256:4ce3ac6cdb6adf7946475d7ef31777c26d94bccc377e070a7986bd2d5c515467", size = 186022 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/7d/ec/bad1ac26764d26aa1353216fcbfa4670050f66d445448aafa227f8b16e80/greenlet-3.1.1-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:4afe7ea89de619adc868e087b4d2359282058479d7cfb94970adf4b55284574d", size = 274260 }, - { url = "https://files.pythonhosted.org/packages/66/d4/c8c04958870f482459ab5956c2942c4ec35cac7fe245527f1039837c17a9/greenlet-3.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f406b22b7c9a9b4f8aa9d2ab13d6ae0ac3e85c9a809bd590ad53fed2bf70dc79", size = 649064 }, - { url = "https://files.pythonhosted.org/packages/51/41/467b12a8c7c1303d20abcca145db2be4e6cd50a951fa30af48b6ec607581/greenlet-3.1.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c3a701fe5a9695b238503ce5bbe8218e03c3bcccf7e204e455e7462d770268aa", size = 663420 }, - { url = "https://files.pythonhosted.org/packages/27/8f/2a93cd9b1e7107d5c7b3b7816eeadcac2ebcaf6d6513df9abaf0334777f6/greenlet-3.1.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2846930c65b47d70b9d178e89c7e1a69c95c1f68ea5aa0a58646b7a96df12441", size = 658035 }, - { url = "https://files.pythonhosted.org/packages/57/5c/7c6f50cb12be092e1dccb2599be5a942c3416dbcfb76efcf54b3f8be4d8d/greenlet-3.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:99cfaa2110534e2cf3ba31a7abcac9d328d1d9f1b95beede58294a60348fba36", size = 660105 }, - { url = "https://files.pythonhosted.org/packages/f1/66/033e58a50fd9ec9df00a8671c74f1f3a320564c6415a4ed82a1c651654ba/greenlet-3.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1443279c19fca463fc33e65ef2a935a5b09bb90f978beab37729e1c3c6c25fe9", size = 613077 }, - { url = "https://files.pythonhosted.org/packages/19/c5/36384a06f748044d06bdd8776e231fadf92fc896bd12cb1c9f5a1bda9578/greenlet-3.1.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b7cede291382a78f7bb5f04a529cb18e068dd29e0fb27376074b6d0317bf4dd0", size = 1135975 }, - { url = "https://files.pythonhosted.org/packages/38/f9/c0a0eb61bdf808d23266ecf1d63309f0e1471f284300ce6dac0ae1231881/greenlet-3.1.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:23f20bb60ae298d7d8656c6ec6db134bca379ecefadb0b19ce6f19d1f232a942", size = 1163955 }, - { url = "https://files.pythonhosted.org/packages/43/21/a5d9df1d21514883333fc86584c07c2b49ba7c602e670b174bd73cfc9c7f/greenlet-3.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:7124e16b4c55d417577c2077be379514321916d5790fa287c9ed6f23bd2ffd01", size = 299655 }, - { url = "https://files.pythonhosted.org/packages/f3/57/0db4940cd7bb461365ca8d6fd53e68254c9dbbcc2b452e69d0d41f10a85e/greenlet-3.1.1-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:05175c27cb459dcfc05d026c4232f9de8913ed006d42713cb8a5137bd49375f1", size = 272990 }, - { url = "https://files.pythonhosted.org/packages/1c/ec/423d113c9f74e5e402e175b157203e9102feeb7088cee844d735b28ef963/greenlet-3.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:935e943ec47c4afab8965954bf49bfa639c05d4ccf9ef6e924188f762145c0ff", size = 649175 }, - { url = "https://files.pythonhosted.org/packages/a9/46/ddbd2db9ff209186b7b7c621d1432e2f21714adc988703dbdd0e65155c77/greenlet-3.1.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:667a9706c970cb552ede35aee17339a18e8f2a87a51fba2ed39ceeeb1004798a", size = 663425 }, - { url = "https://files.pythonhosted.org/packages/bc/f9/9c82d6b2b04aa37e38e74f0c429aece5eeb02bab6e3b98e7db89b23d94c6/greenlet-3.1.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b8a678974d1f3aa55f6cc34dc480169d58f2e6d8958895d68845fa4ab566509e", size = 657736 }, - { url = "https://files.pythonhosted.org/packages/d9/42/b87bc2a81e3a62c3de2b0d550bf91a86939442b7ff85abb94eec3fc0e6aa/greenlet-3.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:efc0f674aa41b92da8c49e0346318c6075d734994c3c4e4430b1c3f853e498e4", size = 660347 }, - { url = "https://files.pythonhosted.org/packages/37/fa/71599c3fd06336cdc3eac52e6871cfebab4d9d70674a9a9e7a482c318e99/greenlet-3.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0153404a4bb921f0ff1abeb5ce8a5131da56b953eda6e14b88dc6bbc04d2049e", size = 615583 }, - { url = "https://files.pythonhosted.org/packages/4e/96/e9ef85de031703ee7a4483489b40cf307f93c1824a02e903106f2ea315fe/greenlet-3.1.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:275f72decf9932639c1c6dd1013a1bc266438eb32710016a1c742df5da6e60a1", size = 1133039 }, - { url = "https://files.pythonhosted.org/packages/87/76/b2b6362accd69f2d1889db61a18c94bc743e961e3cab344c2effaa4b4a25/greenlet-3.1.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:c4aab7f6381f38a4b42f269057aee279ab0fc7bf2e929e3d4abfae97b682a12c", size = 1160716 }, - { url = "https://files.pythonhosted.org/packages/1f/1b/54336d876186920e185066d8c3024ad55f21d7cc3683c856127ddb7b13ce/greenlet-3.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:b42703b1cf69f2aa1df7d1030b9d77d3e584a70755674d60e710f0af570f3761", size = 299490 }, - { url = "https://files.pythonhosted.org/packages/5f/17/bea55bf36990e1638a2af5ba10c1640273ef20f627962cf97107f1e5d637/greenlet-3.1.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f1695e76146579f8c06c1509c7ce4dfe0706f49c6831a817ac04eebb2fd02011", size = 643731 }, - { url = "https://files.pythonhosted.org/packages/78/d2/aa3d2157f9ab742a08e0fd8f77d4699f37c22adfbfeb0c610a186b5f75e0/greenlet-3.1.1-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7876452af029456b3f3549b696bb36a06db7c90747740c5302f74a9e9fa14b13", size = 649304 }, - { url = "https://files.pythonhosted.org/packages/f1/8e/d0aeffe69e53ccff5a28fa86f07ad1d2d2d6537a9506229431a2a02e2f15/greenlet-3.1.1-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4ead44c85f8ab905852d3de8d86f6f8baf77109f9da589cb4fa142bd3b57b475", size = 646537 }, - { url = "https://files.pythonhosted.org/packages/05/79/e15408220bbb989469c8871062c97c6c9136770657ba779711b90870d867/greenlet-3.1.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8320f64b777d00dd7ccdade271eaf0cad6636343293a25074cc5566160e4de7b", size = 642506 }, - { url = "https://files.pythonhosted.org/packages/18/87/470e01a940307796f1d25f8167b551a968540fbe0551c0ebb853cb527dd6/greenlet-3.1.1-cp313-cp313t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6510bf84a6b643dabba74d3049ead221257603a253d0a9873f55f6a59a65f822", size = 602753 }, - { url = "https://files.pythonhosted.org/packages/e2/72/576815ba674eddc3c25028238f74d7b8068902b3968cbe456771b166455e/greenlet-3.1.1-cp313-cp313t-musllinux_1_1_aarch64.whl", hash = "sha256:04b013dc07c96f83134b1e99888e7a79979f1a247e2a9f59697fa14b5862ed01", size = 1122731 }, - { url = "https://files.pythonhosted.org/packages/ac/38/08cc303ddddc4b3d7c628c3039a61a3aae36c241ed01393d00c2fd663473/greenlet-3.1.1-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:411f015496fec93c1c8cd4e5238da364e1da7a124bcb293f085bf2860c32c6f6", size = 1142112 }, -] - -[[package]] -name = "h11" -version = "0.14.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f5/38/3af3d3633a34a3316095b39c8e8fb4853a28a536e55d347bd8d8e9a14b03/h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d", size = 100418 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/95/04/ff642e65ad6b90db43e668d70ffb6736436c7ce41fcc549f4e9472234127/h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761", size = 58259 }, -] - -[[package]] -name = "httpcore" -version = "1.0.7" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "certifi" }, - { name = "h11" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/6a/41/d7d0a89eb493922c37d343b607bc1b5da7f5be7e383740b4753ad8943e90/httpcore-1.0.7.tar.gz", hash = "sha256:8551cb62a169ec7162ac7be8d4817d561f60e08eaa485234898414bb5a8a0b4c", size = 85196 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/87/f5/72347bc88306acb359581ac4d52f23c0ef445b57157adedb9aee0cd689d2/httpcore-1.0.7-py3-none-any.whl", hash = "sha256:a3fff8f43dc260d5bd363d9f9cf1830fa3a458b332856f34282de498ed420edd", size = 78551 }, -] - -[[package]] -name = "httpx" -version = "0.28.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "anyio" }, - { name = "certifi" }, - { name = "httpcore" }, - { name = "idna" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517 }, -] - -[[package]] -name = "idna" -version = "3.10" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f1/70/7703c29685631f5a7590aa73f1f1d3fa9a380e654b86af429e0934a32f7d/idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", size = 190490 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3", size = 70442 }, -] - -[[package]] -name = "jsonpatch" -version = "1.33" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "jsonpointer" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/42/78/18813351fe5d63acad16aec57f94ec2b70a09e53ca98145589e185423873/jsonpatch-1.33.tar.gz", hash = "sha256:9fcd4009c41e6d12348b4a0ff2563ba56a2923a7dfee731d004e212e1ee5030c", size = 21699 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/73/07/02e16ed01e04a374e644b575638ec7987ae846d25ad97bcc9945a3ee4b0e/jsonpatch-1.33-py2.py3-none-any.whl", hash = "sha256:0ae28c0cd062bbd8b8ecc26d7d164fbbea9652a1a3693f3b956c1eae5145dade", size = 12898 }, -] - -[[package]] -name = "jsonpointer" -version = "3.0.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/6a/0a/eebeb1fa92507ea94016a2a790b93c2ae41a7e18778f85471dc54475ed25/jsonpointer-3.0.0.tar.gz", hash = "sha256:2b2d729f2091522d61c3b31f82e11870f60b68f43fbc705cb76bf4b832af59ef", size = 9114 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/71/92/5e77f98553e9e75130c78900d000368476aed74276eb8ae8796f65f00918/jsonpointer-3.0.0-py2.py3-none-any.whl", hash = "sha256:13e088adc14fca8b6aa8177c044e12701e6ad4b28ff10e65f2267a90109c9942", size = 7595 }, -] - -[[package]] -name = "langchain" -version = "0.3.21" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "langchain-core" }, - { name = "langchain-text-splitters" }, - { name = "langsmith" }, - { name = "pydantic" }, - { name = "pyyaml" }, - { name = "requests" }, - { name = "sqlalchemy" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/e7/54/ea3e30df3a7f6f9986cdb5a53d46a219d1e20b5a5e72a480b932a961ff30/langchain-0.3.21.tar.gz", hash = "sha256:a10c81f8c450158af90bf37190298d996208cfd15dd3accc1c585f068473d619", size = 10225431 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c3/89/eeab8c671d791ce872225aa77a05805ba67052764a3faa6331fc4674e855/langchain-0.3.21-py3-none-any.whl", hash = "sha256:c8bd2372440cc5d48cb50b2d532c2e24036124f1c467002ceb15bc7b86c92579", size = 1011714 }, -] - -[[package]] -name = "langchain-core" -version = "0.3.47" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "jsonpatch" }, - { name = "langsmith" }, - { name = "packaging" }, - { name = "pydantic" }, - { name = "pyyaml" }, - { name = "tenacity" }, - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/24/ae/f7764ad1c36aeba561a9cf9eb6774613fdff611f9c91967bb447092baf64/langchain_core-0.3.47.tar.gz", hash = "sha256:975a3daabf8e8d583749b3c553cc412d0527d935dfe820317431b475fa0c585a", size = 531793 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/57/1e/a65339d128f2e957440db21746f66aaf103d34042fcd130c1801da00492d/langchain_core-0.3.47-py3-none-any.whl", hash = "sha256:ef7c78202e6fd9df79fe8128c828d08a95d3878cf4aec282580baf358a3f2ec5", size = 417108 }, -] - -[[package]] -name = "langchain-text-splitters" -version = "0.3.7" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "langchain-core" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/5a/e7/638b44a41e56c3e32cc90cab3622ac2e4c73645252485427d6b2742fcfa8/langchain_text_splitters-0.3.7.tar.gz", hash = "sha256:7dbf0fb98e10bb91792a1d33f540e2287f9cc1dc30ade45b7aedd2d5cd3dc70b", size = 42180 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/d3/85/b7a34b6d34bcc89a2252f5ffea30b94077ba3d7adf72e31b9e04e68c901a/langchain_text_splitters-0.3.7-py3-none-any.whl", hash = "sha256:31ba826013e3f563359d7c7f1e99b1cdb94897f665675ee505718c116e7e20ad", size = 32513 }, -] - -[[package]] -name = "langgraph" -version = "0.3.18" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "langchain-core" }, - { name = "langgraph-checkpoint" }, - { name = "langgraph-prebuilt" }, - { name = "langgraph-sdk" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/4b/b3/59eef17eb411ce97703dcbc673e64fe78aad5e0956a3ddc52c025bdd0a21/langgraph-0.3.18.tar.gz", hash = "sha256:432fb4fcda95b27921b7069b4425eca525d6e03418fdc1082a34265c136d272d", size = 115067 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/3a/dd/d91012b1cd569b51bebf2b072785f80811576db4e34d9d073ae929861560/langgraph-0.3.18-py3-none-any.whl", hash = "sha256:6f6baee7f0914329113fdb33fc5c7f24ef8b657eb664edee58ab1250bd38fa08", size = 136482 }, -] - -[[package]] -name = "langgraph-checkpoint" -version = "2.0.21" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "langchain-core" }, - { name = "msgpack" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/38/40/6919e8b4f773e0a94df882f99e1778b1d6be82f5fc6547adaa514201ab08/langgraph_checkpoint-2.0.21.tar.gz", hash = "sha256:52beeb6dc1bd8c487b8315466cab271093b65eb97f54a0942dfe105cd20b237f", size = 36560 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c2/84/a7ffbac796aea76f8536f72f640d4be4e006af4172ec08f14e125c90bd06/langgraph_checkpoint-2.0.21-py3-none-any.whl", hash = "sha256:ca89c2090cd9729f83f9782226935dc5ff9fe7756c24936f484ccb0ce367f87b", size = 41247 }, -] - -[[package]] -name = "langgraph-prebuilt" -version = "0.1.4" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "langchain-core" }, - { name = "langgraph-checkpoint" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/a9/0b/487fbf469387216d17d2cdcc82952ddd56649ca15953ea4e13b01186976e/langgraph_prebuilt-0.1.4.tar.gz", hash = "sha256:61a5543c6d1be3d54bf53147763b4510d6ab2989347a16d1e9c366ef4dbcf0d8", size = 23409 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c7/bd/a1d898d5e0e3c1e01e4f1a2ee56d4ae03ff7f1d3bbc2b40831ebd8e0d24c/langgraph_prebuilt-0.1.4-py3-none-any.whl", hash = "sha256:23110997d2747cfb7ca2649ca78c6fc950a6646a5c96b7e9d8b7d19221f896a1", size = 24793 }, -] - -[[package]] -name = "langgraph-sdk" -version = "0.1.58" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "httpx" }, - { name = "orjson" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/86/34/d924fbb53da5d6d9448f7ee3d38dee5d213a23eaba7b956cb320b0e32172/langgraph_sdk-0.1.58.tar.gz", hash = "sha256:ef8b0e4c08af8c7efd3919497879c87a3627806b51e4ba5e8b06e0717e3d44cd", size = 43438 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/19/b3/20c2e01ac338daca2bef4a937a93b914e51e8afc79b5537c337abc5b11e4/langgraph_sdk-0.1.58-py3-none-any.whl", hash = "sha256:65f88cf5582da0c316714dc475126fa03c5f74d72bc0b9221dd42649de8e23d4", size = 46504 }, -] - -[[package]] -name = "langsmith" -version = "0.3.18" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "httpx" }, - { name = "orjson", marker = "platform_python_implementation != 'PyPy'" }, - { name = "packaging" }, - { name = "pydantic" }, - { name = "requests" }, - { name = "requests-toolbelt" }, - { name = "zstandard" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/bc/1e/642ad730f8b1960e777a199c371c2f4607b1e411ea61516e90dba56912a6/langsmith-0.3.18.tar.gz", hash = "sha256:18ff2d8f2e77b375485e4fb3d0dbf7b30fabbd438c7347c3534470e9b7d187b8", size = 337237 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/cd/78/a114e3697aa7a161b2b1a4ec4162b1ef15f97e7fe4cbd981781211dfca5a/langsmith-0.3.18-py3-none-any.whl", hash = "sha256:7ad65ec26084312a039885ef625ae72a69ad089818b64bacf7ce6daff672353a", size = 351863 }, -] - -[[package]] -name = "msgpack" -version = "1.1.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/cb/d0/7555686ae7ff5731205df1012ede15dd9d927f6227ea151e901c7406af4f/msgpack-1.1.0.tar.gz", hash = "sha256:dd432ccc2c72b914e4cb77afce64aab761c1137cc698be3984eee260bcb2896e", size = 167260 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e1/d6/716b7ca1dbde63290d2973d22bbef1b5032ca634c3ff4384a958ec3f093a/msgpack-1.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:d46cf9e3705ea9485687aa4001a76e44748b609d260af21c4ceea7f2212a501d", size = 152421 }, - { url = "https://files.pythonhosted.org/packages/70/da/5312b067f6773429cec2f8f08b021c06af416bba340c912c2ec778539ed6/msgpack-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:5dbad74103df937e1325cc4bfeaf57713be0b4f15e1c2da43ccdd836393e2ea2", size = 85277 }, - { url = "https://files.pythonhosted.org/packages/28/51/da7f3ae4462e8bb98af0d5bdf2707f1b8c65a0d4f496e46b6afb06cbc286/msgpack-1.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:58dfc47f8b102da61e8949708b3eafc3504509a5728f8b4ddef84bd9e16ad420", size = 82222 }, - { url = "https://files.pythonhosted.org/packages/33/af/dc95c4b2a49cff17ce47611ca9ba218198806cad7796c0b01d1e332c86bb/msgpack-1.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4676e5be1b472909b2ee6356ff425ebedf5142427842aa06b4dfd5117d1ca8a2", size = 392971 }, - { url = "https://files.pythonhosted.org/packages/f1/54/65af8de681fa8255402c80eda2a501ba467921d5a7a028c9c22a2c2eedb5/msgpack-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:17fb65dd0bec285907f68b15734a993ad3fc94332b5bb21b0435846228de1f39", size = 401403 }, - { url = "https://files.pythonhosted.org/packages/97/8c/e333690777bd33919ab7024269dc3c41c76ef5137b211d776fbb404bfead/msgpack-1.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a51abd48c6d8ac89e0cfd4fe177c61481aca2d5e7ba42044fd218cfd8ea9899f", size = 385356 }, - { url = "https://files.pythonhosted.org/packages/57/52/406795ba478dc1c890559dd4e89280fa86506608a28ccf3a72fbf45df9f5/msgpack-1.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2137773500afa5494a61b1208619e3871f75f27b03bcfca7b3a7023284140247", size = 383028 }, - { url = "https://files.pythonhosted.org/packages/e7/69/053b6549bf90a3acadcd8232eae03e2fefc87f066a5b9fbb37e2e608859f/msgpack-1.1.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:398b713459fea610861c8a7b62a6fec1882759f308ae0795b5413ff6a160cf3c", size = 391100 }, - { url = "https://files.pythonhosted.org/packages/23/f0/d4101d4da054f04274995ddc4086c2715d9b93111eb9ed49686c0f7ccc8a/msgpack-1.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:06f5fd2f6bb2a7914922d935d3b8bb4a7fff3a9a91cfce6d06c13bc42bec975b", size = 394254 }, - { url = "https://files.pythonhosted.org/packages/1c/12/cf07458f35d0d775ff3a2dc5559fa2e1fcd06c46f1ef510e594ebefdca01/msgpack-1.1.0-cp312-cp312-win32.whl", hash = "sha256:ad33e8400e4ec17ba782f7b9cf868977d867ed784a1f5f2ab46e7ba53b6e1e1b", size = 69085 }, - { url = "https://files.pythonhosted.org/packages/73/80/2708a4641f7d553a63bc934a3eb7214806b5b39d200133ca7f7afb0a53e8/msgpack-1.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:115a7af8ee9e8cddc10f87636767857e7e3717b7a2e97379dc2054712693e90f", size = 75347 }, - { url = "https://files.pythonhosted.org/packages/c8/b0/380f5f639543a4ac413e969109978feb1f3c66e931068f91ab6ab0f8be00/msgpack-1.1.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:071603e2f0771c45ad9bc65719291c568d4edf120b44eb36324dcb02a13bfddf", size = 151142 }, - { url = "https://files.pythonhosted.org/packages/c8/ee/be57e9702400a6cb2606883d55b05784fada898dfc7fd12608ab1fdb054e/msgpack-1.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0f92a83b84e7c0749e3f12821949d79485971f087604178026085f60ce109330", size = 84523 }, - { url = "https://files.pythonhosted.org/packages/7e/3a/2919f63acca3c119565449681ad08a2f84b2171ddfcff1dba6959db2cceb/msgpack-1.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:4a1964df7b81285d00a84da4e70cb1383f2e665e0f1f2a7027e683956d04b734", size = 81556 }, - { url = "https://files.pythonhosted.org/packages/7c/43/a11113d9e5c1498c145a8925768ea2d5fce7cbab15c99cda655aa09947ed/msgpack-1.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:59caf6a4ed0d164055ccff8fe31eddc0ebc07cf7326a2aaa0dbf7a4001cd823e", size = 392105 }, - { url = "https://files.pythonhosted.org/packages/2d/7b/2c1d74ca6c94f70a1add74a8393a0138172207dc5de6fc6269483519d048/msgpack-1.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0907e1a7119b337971a689153665764adc34e89175f9a34793307d9def08e6ca", size = 399979 }, - { url = "https://files.pythonhosted.org/packages/82/8c/cf64ae518c7b8efc763ca1f1348a96f0e37150061e777a8ea5430b413a74/msgpack-1.1.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:65553c9b6da8166e819a6aa90ad15288599b340f91d18f60b2061f402b9a4915", size = 383816 }, - { url = "https://files.pythonhosted.org/packages/69/86/a847ef7a0f5ef3fa94ae20f52a4cacf596a4e4a010197fbcc27744eb9a83/msgpack-1.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:7a946a8992941fea80ed4beae6bff74ffd7ee129a90b4dd5cf9c476a30e9708d", size = 380973 }, - { url = "https://files.pythonhosted.org/packages/aa/90/c74cf6e1126faa93185d3b830ee97246ecc4fe12cf9d2d31318ee4246994/msgpack-1.1.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:4b51405e36e075193bc051315dbf29168d6141ae2500ba8cd80a522964e31434", size = 387435 }, - { url = "https://files.pythonhosted.org/packages/7a/40/631c238f1f338eb09f4acb0f34ab5862c4e9d7eda11c1b685471a4c5ea37/msgpack-1.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:b4c01941fd2ff87c2a934ee6055bda4ed353a7846b8d4f341c428109e9fcde8c", size = 399082 }, - { url = "https://files.pythonhosted.org/packages/e9/1b/fa8a952be252a1555ed39f97c06778e3aeb9123aa4cccc0fd2acd0b4e315/msgpack-1.1.0-cp313-cp313-win32.whl", hash = "sha256:7c9a35ce2c2573bada929e0b7b3576de647b0defbd25f5139dcdaba0ae35a4cc", size = 69037 }, - { url = "https://files.pythonhosted.org/packages/b6/bc/8bd826dd03e022153bfa1766dcdec4976d6c818865ed54223d71f07862b3/msgpack-1.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:bce7d9e614a04d0883af0b3d4d501171fbfca038f12c77fa838d9f198147a23f", size = 75140 }, -] - -[[package]] -name = "orjson" -version = "3.10.15" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/ae/f9/5dea21763eeff8c1590076918a446ea3d6140743e0e36f58f369928ed0f4/orjson-3.10.15.tar.gz", hash = "sha256:05ca7fe452a2e9d8d9d706a2984c95b9c2ebc5db417ce0b7a49b91d50642a23e", size = 5282482 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/66/85/22fe737188905a71afcc4bf7cc4c79cd7f5bbe9ed1fe0aac4ce4c33edc30/orjson-3.10.15-cp312-cp312-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:9d11c0714fc85bfcf36ada1179400862da3288fc785c30e8297844c867d7505a", size = 249504 }, - { url = "https://files.pythonhosted.org/packages/48/b7/2622b29f3afebe938a0a9037e184660379797d5fd5234e5998345d7a5b43/orjson-3.10.15-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dba5a1e85d554e3897fa9fe6fbcff2ed32d55008973ec9a2b992bd9a65d2352d", size = 125080 }, - { url = "https://files.pythonhosted.org/packages/ce/8f/0b72a48f4403d0b88b2a41450c535b3e8989e8a2d7800659a967efc7c115/orjson-3.10.15-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7723ad949a0ea502df656948ddd8b392780a5beaa4c3b5f97e525191b102fff0", size = 150121 }, - { url = "https://files.pythonhosted.org/packages/06/ec/acb1a20cd49edb2000be5a0404cd43e3c8aad219f376ac8c60b870518c03/orjson-3.10.15-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6fd9bc64421e9fe9bd88039e7ce8e58d4fead67ca88e3a4014b143cec7684fd4", size = 139796 }, - { url = "https://files.pythonhosted.org/packages/33/e1/f7840a2ea852114b23a52a1c0b2bea0a1ea22236efbcdb876402d799c423/orjson-3.10.15-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dadba0e7b6594216c214ef7894c4bd5f08d7c0135f4dd0145600be4fbcc16767", size = 154636 }, - { url = "https://files.pythonhosted.org/packages/fa/da/31543337febd043b8fa80a3b67de627669b88c7b128d9ad4cc2ece005b7a/orjson-3.10.15-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b48f59114fe318f33bbaee8ebeda696d8ccc94c9e90bc27dbe72153094e26f41", size = 130621 }, - { url = "https://files.pythonhosted.org/packages/ed/78/66115dc9afbc22496530d2139f2f4455698be444c7c2475cb48f657cefc9/orjson-3.10.15-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:035fb83585e0f15e076759b6fedaf0abb460d1765b6a36f48018a52858443514", size = 138516 }, - { url = "https://files.pythonhosted.org/packages/22/84/cd4f5fb5427ffcf823140957a47503076184cb1ce15bcc1165125c26c46c/orjson-3.10.15-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:d13b7fe322d75bf84464b075eafd8e7dd9eae05649aa2a5354cfa32f43c59f17", size = 130762 }, - { url = "https://files.pythonhosted.org/packages/93/1f/67596b711ba9f56dd75d73b60089c5c92057f1130bb3a25a0f53fb9a583b/orjson-3.10.15-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:7066b74f9f259849629e0d04db6609db4cf5b973248f455ba5d3bd58a4daaa5b", size = 414700 }, - { url = "https://files.pythonhosted.org/packages/7c/0c/6a3b3271b46443d90efb713c3e4fe83fa8cd71cda0d11a0f69a03f437c6e/orjson-3.10.15-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:88dc3f65a026bd3175eb157fea994fca6ac7c4c8579fc5a86fc2114ad05705b7", size = 141077 }, - { url = "https://files.pythonhosted.org/packages/3b/9b/33c58e0bfc788995eccd0d525ecd6b84b40d7ed182dd0751cd4c1322ac62/orjson-3.10.15-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b342567e5465bd99faa559507fe45e33fc76b9fb868a63f1642c6bc0735ad02a", size = 129898 }, - { url = "https://files.pythonhosted.org/packages/01/c1/d577ecd2e9fa393366a1ea0a9267f6510d86e6c4bb1cdfb9877104cac44c/orjson-3.10.15-cp312-cp312-win32.whl", hash = "sha256:0a4f27ea5617828e6b58922fdbec67b0aa4bb844e2d363b9244c47fa2180e665", size = 142566 }, - { url = "https://files.pythonhosted.org/packages/ed/eb/a85317ee1732d1034b92d56f89f1de4d7bf7904f5c8fb9dcdd5b1c83917f/orjson-3.10.15-cp312-cp312-win_amd64.whl", hash = "sha256:ef5b87e7aa9545ddadd2309efe6824bd3dd64ac101c15dae0f2f597911d46eaa", size = 133732 }, - { url = "https://files.pythonhosted.org/packages/06/10/fe7d60b8da538e8d3d3721f08c1b7bff0491e8fa4dd3bf11a17e34f4730e/orjson-3.10.15-cp313-cp313-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:bae0e6ec2b7ba6895198cd981b7cca95d1487d0147c8ed751e5632ad16f031a6", size = 249399 }, - { url = "https://files.pythonhosted.org/packages/6b/83/52c356fd3a61abd829ae7e4366a6fe8e8863c825a60d7ac5156067516edf/orjson-3.10.15-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f93ce145b2db1252dd86af37d4165b6faa83072b46e3995ecc95d4b2301b725a", size = 125044 }, - { url = "https://files.pythonhosted.org/packages/55/b2/d06d5901408e7ded1a74c7c20d70e3a127057a6d21355f50c90c0f337913/orjson-3.10.15-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7c203f6f969210128af3acae0ef9ea6aab9782939f45f6fe02d05958fe761ef9", size = 150066 }, - { url = "https://files.pythonhosted.org/packages/75/8c/60c3106e08dc593a861755781c7c675a566445cc39558677d505878d879f/orjson-3.10.15-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8918719572d662e18b8af66aef699d8c21072e54b6c82a3f8f6404c1f5ccd5e0", size = 139737 }, - { url = "https://files.pythonhosted.org/packages/6a/8c/ae00d7d0ab8a4490b1efeb01ad4ab2f1982e69cc82490bf8093407718ff5/orjson-3.10.15-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f71eae9651465dff70aa80db92586ad5b92df46a9373ee55252109bb6b703307", size = 154804 }, - { url = "https://files.pythonhosted.org/packages/22/86/65dc69bd88b6dd254535310e97bc518aa50a39ef9c5a2a5d518e7a223710/orjson-3.10.15-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e117eb299a35f2634e25ed120c37c641398826c2f5a3d3cc39f5993b96171b9e", size = 130583 }, - { url = "https://files.pythonhosted.org/packages/bb/00/6fe01ededb05d52be42fabb13d93a36e51f1fd9be173bd95707d11a8a860/orjson-3.10.15-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:13242f12d295e83c2955756a574ddd6741c81e5b99f2bef8ed8d53e47a01e4b7", size = 138465 }, - { url = "https://files.pythonhosted.org/packages/db/2f/4cc151c4b471b0cdc8cb29d3eadbce5007eb0475d26fa26ed123dca93b33/orjson-3.10.15-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:7946922ada8f3e0b7b958cc3eb22cfcf6c0df83d1fe5521b4a100103e3fa84c8", size = 130742 }, - { url = "https://files.pythonhosted.org/packages/9f/13/8a6109e4b477c518498ca37963d9c0eb1508b259725553fb53d53b20e2ea/orjson-3.10.15-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:b7155eb1623347f0f22c38c9abdd738b287e39b9982e1da227503387b81b34ca", size = 414669 }, - { url = "https://files.pythonhosted.org/packages/22/7b/1d229d6d24644ed4d0a803de1b0e2df832032d5beda7346831c78191b5b2/orjson-3.10.15-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:208beedfa807c922da4e81061dafa9c8489c6328934ca2a562efa707e049e561", size = 141043 }, - { url = "https://files.pythonhosted.org/packages/cc/d3/6dc91156cf12ed86bed383bcb942d84d23304a1e57b7ab030bf60ea130d6/orjson-3.10.15-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:eca81f83b1b8c07449e1d6ff7074e82e3fd6777e588f1a6632127f286a968825", size = 129826 }, - { url = "https://files.pythonhosted.org/packages/b3/38/c47c25b86f6996f1343be721b6ea4367bc1c8bc0fc3f6bbcd995d18cb19d/orjson-3.10.15-cp313-cp313-win32.whl", hash = "sha256:c03cd6eea1bd3b949d0d007c8d57049aa2b39bd49f58b4b2af571a5d3833d890", size = 142542 }, - { url = "https://files.pythonhosted.org/packages/27/f1/1d7ec15b20f8ce9300bc850de1e059132b88990e46cd0ccac29cbf11e4f9/orjson-3.10.15-cp313-cp313-win_amd64.whl", hash = "sha256:fd56a26a04f6ba5fb2045b0acc487a63162a958ed837648c5781e1fe3316cfbf", size = 133444 }, -] - -[[package]] -name = "packaging" -version = "24.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, -] - -[[package]] -name = "pycparser" -version = "2.22" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/1d/b2/31537cf4b1ca988837256c910a668b553fceb8f069bedc4b1c826024b52c/pycparser-2.22.tar.gz", hash = "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6", size = 172736 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/13/a3/a812df4e2dd5696d1f351d58b8fe16a405b234ad2886a0dab9183fb78109/pycparser-2.22-py3-none-any.whl", hash = "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc", size = 117552 }, -] - -[[package]] -name = "pydantic" -version = "2.10.6" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "annotated-types" }, - { name = "pydantic-core" }, - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/b7/ae/d5220c5c52b158b1de7ca89fc5edb72f304a70a4c540c84c8844bf4008de/pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236", size = 761681 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/f4/3c/8cc1cc84deffa6e25d2d0c688ebb80635dfdbf1dbea3e30c541c8cf4d860/pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584", size = 431696 }, -] - -[[package]] -name = "pydantic-core" -version = "2.27.2" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/fc/01/f3e5ac5e7c25833db5eb555f7b7ab24cd6f8c322d3a3ad2d67a952dc0abc/pydantic_core-2.27.2.tar.gz", hash = "sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39", size = 413443 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/d6/74/51c8a5482ca447871c93e142d9d4a92ead74de6c8dc5e66733e22c9bba89/pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0", size = 1893127 }, - { url = "https://files.pythonhosted.org/packages/d3/f3/c97e80721735868313c58b89d2de85fa80fe8dfeeed84dc51598b92a135e/pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef", size = 1811340 }, - { url = "https://files.pythonhosted.org/packages/9e/91/840ec1375e686dbae1bd80a9e46c26a1e0083e1186abc610efa3d9a36180/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7", size = 1822900 }, - { url = "https://files.pythonhosted.org/packages/f6/31/4240bc96025035500c18adc149aa6ffdf1a0062a4b525c932065ceb4d868/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934", size = 1869177 }, - { url = "https://files.pythonhosted.org/packages/fa/20/02fbaadb7808be578317015c462655c317a77a7c8f0ef274bc016a784c54/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6", size = 2038046 }, - { url = "https://files.pythonhosted.org/packages/06/86/7f306b904e6c9eccf0668248b3f272090e49c275bc488a7b88b0823444a4/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c", size = 2685386 }, - { url = "https://files.pythonhosted.org/packages/8d/f0/49129b27c43396581a635d8710dae54a791b17dfc50c70164866bbf865e3/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2", size = 1997060 }, - { url = "https://files.pythonhosted.org/packages/0d/0f/943b4af7cd416c477fd40b187036c4f89b416a33d3cc0ab7b82708a667aa/pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4", size = 2004870 }, - { url = "https://files.pythonhosted.org/packages/35/40/aea70b5b1a63911c53a4c8117c0a828d6790483f858041f47bab0b779f44/pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3", size = 1999822 }, - { url = "https://files.pythonhosted.org/packages/f2/b3/807b94fd337d58effc5498fd1a7a4d9d59af4133e83e32ae39a96fddec9d/pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4", size = 2130364 }, - { url = "https://files.pythonhosted.org/packages/fc/df/791c827cd4ee6efd59248dca9369fb35e80a9484462c33c6649a8d02b565/pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57", size = 2158303 }, - { url = "https://files.pythonhosted.org/packages/9b/67/4e197c300976af185b7cef4c02203e175fb127e414125916bf1128b639a9/pydantic_core-2.27.2-cp312-cp312-win32.whl", hash = "sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc", size = 1834064 }, - { url = "https://files.pythonhosted.org/packages/1f/ea/cd7209a889163b8dcca139fe32b9687dd05249161a3edda62860430457a5/pydantic_core-2.27.2-cp312-cp312-win_amd64.whl", hash = "sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9", size = 1989046 }, - { url = "https://files.pythonhosted.org/packages/bc/49/c54baab2f4658c26ac633d798dab66b4c3a9bbf47cff5284e9c182f4137a/pydantic_core-2.27.2-cp312-cp312-win_arm64.whl", hash = "sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b", size = 1885092 }, - { url = "https://files.pythonhosted.org/packages/41/b1/9bc383f48f8002f99104e3acff6cba1231b29ef76cfa45d1506a5cad1f84/pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b", size = 1892709 }, - { url = "https://files.pythonhosted.org/packages/10/6c/e62b8657b834f3eb2961b49ec8e301eb99946245e70bf42c8817350cbefc/pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154", size = 1811273 }, - { url = "https://files.pythonhosted.org/packages/ba/15/52cfe49c8c986e081b863b102d6b859d9defc63446b642ccbbb3742bf371/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9", size = 1823027 }, - { url = "https://files.pythonhosted.org/packages/b1/1c/b6f402cfc18ec0024120602bdbcebc7bdd5b856528c013bd4d13865ca473/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9", size = 1868888 }, - { url = "https://files.pythonhosted.org/packages/bd/7b/8cb75b66ac37bc2975a3b7de99f3c6f355fcc4d89820b61dffa8f1e81677/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1", size = 2037738 }, - { url = "https://files.pythonhosted.org/packages/c8/f1/786d8fe78970a06f61df22cba58e365ce304bf9b9f46cc71c8c424e0c334/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a", size = 2685138 }, - { url = "https://files.pythonhosted.org/packages/a6/74/d12b2cd841d8724dc8ffb13fc5cef86566a53ed358103150209ecd5d1999/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e", size = 1997025 }, - { url = "https://files.pythonhosted.org/packages/a0/6e/940bcd631bc4d9a06c9539b51f070b66e8f370ed0933f392db6ff350d873/pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4", size = 2004633 }, - { url = "https://files.pythonhosted.org/packages/50/cc/a46b34f1708d82498c227d5d80ce615b2dd502ddcfd8376fc14a36655af1/pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27", size = 1999404 }, - { url = "https://files.pythonhosted.org/packages/ca/2d/c365cfa930ed23bc58c41463bae347d1005537dc8db79e998af8ba28d35e/pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee", size = 2130130 }, - { url = "https://files.pythonhosted.org/packages/f4/d7/eb64d015c350b7cdb371145b54d96c919d4db516817f31cd1c650cae3b21/pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1", size = 2157946 }, - { url = "https://files.pythonhosted.org/packages/a4/99/bddde3ddde76c03b65dfd5a66ab436c4e58ffc42927d4ff1198ffbf96f5f/pydantic_core-2.27.2-cp313-cp313-win32.whl", hash = "sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130", size = 1834387 }, - { url = "https://files.pythonhosted.org/packages/71/47/82b5e846e01b26ac6f1893d3c5f9f3a2eb6ba79be26eef0b759b4fe72946/pydantic_core-2.27.2-cp313-cp313-win_amd64.whl", hash = "sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee", size = 1990453 }, - { url = "https://files.pythonhosted.org/packages/51/b2/b2b50d5ecf21acf870190ae5d093602d95f66c9c31f9d5de6062eb329ad1/pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b", size = 1885186 }, -] - -[[package]] -name = "pyyaml" -version = "6.0.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/54/ed/79a089b6be93607fa5cdaedf301d7dfb23af5f25c398d5ead2525b063e17/pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e", size = 130631 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/86/0c/c581167fc46d6d6d7ddcfb8c843a4de25bdd27e4466938109ca68492292c/PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab", size = 183873 }, - { url = "https://files.pythonhosted.org/packages/a8/0c/38374f5bb272c051e2a69281d71cba6fdb983413e6758b84482905e29a5d/PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725", size = 173302 }, - { url = "https://files.pythonhosted.org/packages/c3/93/9916574aa8c00aa06bbac729972eb1071d002b8e158bd0e83a3b9a20a1f7/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5", size = 739154 }, - { url = "https://files.pythonhosted.org/packages/95/0f/b8938f1cbd09739c6da569d172531567dbcc9789e0029aa070856f123984/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425", size = 766223 }, - { url = "https://files.pythonhosted.org/packages/b9/2b/614b4752f2e127db5cc206abc23a8c19678e92b23c3db30fc86ab731d3bd/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476", size = 767542 }, - { url = "https://files.pythonhosted.org/packages/d4/00/dd137d5bcc7efea1836d6264f049359861cf548469d18da90cd8216cf05f/PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48", size = 731164 }, - { url = "https://files.pythonhosted.org/packages/c9/1f/4f998c900485e5c0ef43838363ba4a9723ac0ad73a9dc42068b12aaba4e4/PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b", size = 756611 }, - { url = "https://files.pythonhosted.org/packages/df/d1/f5a275fdb252768b7a11ec63585bc38d0e87c9e05668a139fea92b80634c/PyYAML-6.0.2-cp312-cp312-win32.whl", hash = "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4", size = 140591 }, - { url = "https://files.pythonhosted.org/packages/0c/e8/4f648c598b17c3d06e8753d7d13d57542b30d56e6c2dedf9c331ae56312e/PyYAML-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8", size = 156338 }, - { url = "https://files.pythonhosted.org/packages/ef/e3/3af305b830494fa85d95f6d95ef7fa73f2ee1cc8ef5b495c7c3269fb835f/PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba", size = 181309 }, - { url = "https://files.pythonhosted.org/packages/45/9f/3b1c20a0b7a3200524eb0076cc027a970d320bd3a6592873c85c92a08731/PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1", size = 171679 }, - { url = "https://files.pythonhosted.org/packages/7c/9a/337322f27005c33bcb656c655fa78325b730324c78620e8328ae28b64d0c/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133", size = 733428 }, - { url = "https://files.pythonhosted.org/packages/a3/69/864fbe19e6c18ea3cc196cbe5d392175b4cf3d5d0ac1403ec3f2d237ebb5/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484", size = 763361 }, - { url = "https://files.pythonhosted.org/packages/04/24/b7721e4845c2f162d26f50521b825fb061bc0a5afcf9a386840f23ea19fa/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5", size = 759523 }, - { url = "https://files.pythonhosted.org/packages/2b/b2/e3234f59ba06559c6ff63c4e10baea10e5e7df868092bf9ab40e5b9c56b6/PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc", size = 726660 }, - { url = "https://files.pythonhosted.org/packages/fe/0f/25911a9f080464c59fab9027482f822b86bf0608957a5fcc6eaac85aa515/PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652", size = 751597 }, - { url = "https://files.pythonhosted.org/packages/14/0d/e2c3b43bbce3cf6bd97c840b46088a3031085179e596d4929729d8d68270/PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183", size = 140527 }, - { url = "https://files.pythonhosted.org/packages/fa/de/02b54f42487e3d3c6efb3f89428677074ca7bf43aae402517bc7cca949f3/PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563", size = 156446 }, -] - -[[package]] -name = "requests" -version = "2.32.3" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "certifi" }, - { name = "charset-normalizer" }, - { name = "idna" }, - { name = "urllib3" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/63/70/2bf7780ad2d390a8d301ad0b550f1581eadbd9a20f896afe06353c2a2913/requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760", size = 131218 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/f9/9b/335f9764261e915ed497fcdeb11df5dfd6f7bf257d4a6a2a686d80da4d54/requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6", size = 64928 }, -] - -[[package]] -name = "requests-toolbelt" -version = "1.0.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "requests" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/f3/61/d7545dafb7ac2230c70d38d31cbfe4cc64f7144dc41f6e4e4b78ecd9f5bb/requests-toolbelt-1.0.0.tar.gz", hash = "sha256:7681a0a3d047012b5bdc0ee37d7f8f07ebe76ab08caeccfc3921ce23c88d5bc6", size = 206888 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/3f/51/d4db610ef29373b879047326cbf6fa98b6c1969d6f6dc423279de2b1be2c/requests_toolbelt-1.0.0-py2.py3-none-any.whl", hash = "sha256:cccfdd665f0a24fcf4726e690f65639d272bb0637b9b92dfd91a5568ccf6bd06", size = 54481 }, -] - -[[package]] -name = "sniffio" -version = "1.3.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a2/87/a6771e1546d97e7e041b6ae58d80074f81b7d5121207425c964ddf5cfdbd/sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc", size = 20372 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235 }, -] - -[[package]] -name = "sqlalchemy" -version = "2.0.39" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "greenlet", marker = "(python_full_version < '3.14' and platform_machine == 'AMD64') or (python_full_version < '3.14' and platform_machine == 'WIN32') or (python_full_version < '3.14' and platform_machine == 'aarch64') or (python_full_version < '3.14' and platform_machine == 'amd64') or (python_full_version < '3.14' and platform_machine == 'ppc64le') or (python_full_version < '3.14' and platform_machine == 'win32') or (python_full_version < '3.14' and platform_machine == 'x86_64')" }, - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/00/8e/e77fcaa67f8b9f504b4764570191e291524575ddbfe78a90fc656d671fdc/sqlalchemy-2.0.39.tar.gz", hash = "sha256:5d2d1fe548def3267b4c70a8568f108d1fed7cbbeccb9cc166e05af2abc25c22", size = 9644602 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/98/86/b2cb432aeb00a1eda7ed33ce86d943c2452dc1642f3ec51bfe9eaae9604b/sqlalchemy-2.0.39-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c457a38351fb6234781d054260c60e531047e4d07beca1889b558ff73dc2014b", size = 2107210 }, - { url = "https://files.pythonhosted.org/packages/bf/b0/b2479edb3419ca763ba1b587161c292d181351a33642985506a530f9162b/sqlalchemy-2.0.39-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:018ee97c558b499b58935c5a152aeabf6d36b3d55d91656abeb6d93d663c0c4c", size = 2097599 }, - { url = "https://files.pythonhosted.org/packages/58/5e/c5b792a4abcc71e68d44cb531c4845ac539d558975cc61db1afbc8a73c96/sqlalchemy-2.0.39-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5493a8120d6fc185f60e7254fc056a6742f1db68c0f849cfc9ab46163c21df47", size = 3247012 }, - { url = "https://files.pythonhosted.org/packages/e0/a8/055fa8a7c5f85e6123b7e40ec2e9e87d63c566011d599b4a5ab75e033017/sqlalchemy-2.0.39-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b2cf5b5ddb69142511d5559c427ff00ec8c0919a1e6c09486e9c32636ea2b9dd", size = 3257851 }, - { url = "https://files.pythonhosted.org/packages/f6/40/aec16681e91a22ddf03dbaeb3c659bce96107c5f47d2a7c665eb7f24a014/sqlalchemy-2.0.39-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:9f03143f8f851dd8de6b0c10784363712058f38209e926723c80654c1b40327a", size = 3193155 }, - { url = "https://files.pythonhosted.org/packages/21/9d/cef697b137b9eb0b66ab8e9cf193a7c7c048da3b4bb667e5fcea4d90c7a2/sqlalchemy-2.0.39-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:06205eb98cb3dd52133ca6818bf5542397f1dd1b69f7ea28aa84413897380b06", size = 3219770 }, - { url = "https://files.pythonhosted.org/packages/57/05/e109ca7dde837d8f2f1b235357e4e607f8af81ad8bc29c230fed8245687d/sqlalchemy-2.0.39-cp312-cp312-win32.whl", hash = "sha256:7f5243357e6da9a90c56282f64b50d29cba2ee1f745381174caacc50d501b109", size = 2077567 }, - { url = "https://files.pythonhosted.org/packages/97/c6/25ca068e38c29ed6be0fde2521888f19da923dbd58f5ff16af1b73ec9b58/sqlalchemy-2.0.39-cp312-cp312-win_amd64.whl", hash = "sha256:2ed107331d188a286611cea9022de0afc437dd2d3c168e368169f27aa0f61338", size = 2103136 }, - { url = "https://files.pythonhosted.org/packages/32/47/55778362642344324a900b6b2b1b26f7f02225b374eb93adc4a363a2d8ae/sqlalchemy-2.0.39-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:fe193d3ae297c423e0e567e240b4324d6b6c280a048e64c77a3ea6886cc2aa87", size = 2102484 }, - { url = "https://files.pythonhosted.org/packages/1b/e1/f5f26f67d095f408138f0fb2c37f827f3d458f2ae51881546045e7e55566/sqlalchemy-2.0.39-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:79f4f502125a41b1b3b34449e747a6abfd52a709d539ea7769101696bdca6716", size = 2092955 }, - { url = "https://files.pythonhosted.org/packages/c5/c2/0db0022fc729a54fc7aef90a3457bf20144a681baef82f7357832b44c566/sqlalchemy-2.0.39-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8a10ca7f8a1ea0fd5630f02feb055b0f5cdfcd07bb3715fc1b6f8cb72bf114e4", size = 3179367 }, - { url = "https://files.pythonhosted.org/packages/33/b7/f33743d87d0b4e7a1f12e1631a4b9a29a8d0d7c0ff9b8c896d0bf897fb60/sqlalchemy-2.0.39-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e6b0a1c7ed54a5361aaebb910c1fa864bae34273662bb4ff788a527eafd6e14d", size = 3192705 }, - { url = "https://files.pythonhosted.org/packages/c9/74/6814f31719109c973ddccc87bdfc2c2a9bc013bec64a375599dc5269a310/sqlalchemy-2.0.39-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:52607d0ebea43cf214e2ee84a6a76bc774176f97c5a774ce33277514875a718e", size = 3125927 }, - { url = "https://files.pythonhosted.org/packages/e8/6b/18f476f4baaa9a0e2fbc6808d8f958a5268b637c8eccff497bf96908d528/sqlalchemy-2.0.39-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:c08a972cbac2a14810463aec3a47ff218bb00c1a607e6689b531a7c589c50723", size = 3154055 }, - { url = "https://files.pythonhosted.org/packages/b4/60/76714cecb528da46bc53a0dd36d1ccef2f74ef25448b630a0a760ad07bdb/sqlalchemy-2.0.39-cp313-cp313-win32.whl", hash = "sha256:23c5aa33c01bd898f879db158537d7e7568b503b15aad60ea0c8da8109adf3e7", size = 2075315 }, - { url = "https://files.pythonhosted.org/packages/5b/7c/76828886d913700548bac5851eefa5b2c0251ebc37921fe476b93ce81b50/sqlalchemy-2.0.39-cp313-cp313-win_amd64.whl", hash = "sha256:4dabd775fd66cf17f31f8625fc0e4cfc5765f7982f94dc09b9e5868182cb71c0", size = 2099175 }, - { url = "https://files.pythonhosted.org/packages/7b/0f/d69904cb7d17e65c65713303a244ec91fd3c96677baf1d6331457fd47e16/sqlalchemy-2.0.39-py3-none-any.whl", hash = "sha256:a1c6b0a5e3e326a466d809b651c63f278b1256146a377a528b6938a279da334f", size = 1898621 }, -] - -[[package]] -name = "tenacity" -version = "9.0.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/cd/94/91fccdb4b8110642462e653d5dcb27e7b674742ad68efd146367da7bdb10/tenacity-9.0.0.tar.gz", hash = "sha256:807f37ca97d62aa361264d497b0e31e92b8027044942bfa756160d908320d73b", size = 47421 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b6/cb/b86984bed139586d01532a587464b5805f12e397594f19f931c4c2fbfa61/tenacity-9.0.0-py3-none-any.whl", hash = "sha256:93de0c98785b27fcf659856aa9f54bfbd399e29969b0621bc7f762bd441b4539", size = 28169 }, -] - -[[package]] -name = "typing-extensions" -version = "4.12.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/df/db/f35a00659bc03fec321ba8bce9420de607a1d37f8342eee1863174c69557/typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8", size = 85321 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/26/9f/ad63fc0248c5379346306f8668cda6e2e2e9c95e01216d2b8ffd9ff037d0/typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d", size = 37438 }, -] - -[[package]] -name = "urllib3" -version = "2.3.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/aa/63/e53da845320b757bf29ef6a9062f5c669fe997973f966045cb019c3f4b66/urllib3-2.3.0.tar.gz", hash = "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d", size = 307268 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c8/19/4ec628951a74043532ca2cf5d97b7b14863931476d117c471e8e2b1eb39f/urllib3-2.3.0-py3-none-any.whl", hash = "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df", size = 128369 }, -] - -[[package]] -name = "zstandard" -version = "0.23.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "cffi", marker = "platform_python_implementation == 'PyPy'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/ed/f6/2ac0287b442160a89d726b17a9184a4c615bb5237db763791a7fd16d9df1/zstandard-0.23.0.tar.gz", hash = "sha256:b2d8c62d08e7255f68f7a740bae85b3c9b8e5466baa9cbf7f57f1cde0ac6bc09", size = 681701 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/7b/83/f23338c963bd9de687d47bf32efe9fd30164e722ba27fb59df33e6b1719b/zstandard-0.23.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b4567955a6bc1b20e9c31612e615af6b53733491aeaa19a6b3b37f3b65477094", size = 788713 }, - { url = "https://files.pythonhosted.org/packages/5b/b3/1a028f6750fd9227ee0b937a278a434ab7f7fdc3066c3173f64366fe2466/zstandard-0.23.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1e172f57cd78c20f13a3415cc8dfe24bf388614324d25539146594c16d78fcc8", size = 633459 }, - { url = "https://files.pythonhosted.org/packages/26/af/36d89aae0c1f95a0a98e50711bc5d92c144939efc1f81a2fcd3e78d7f4c1/zstandard-0.23.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b0e166f698c5a3e914947388c162be2583e0c638a4703fc6a543e23a88dea3c1", size = 4945707 }, - { url = "https://files.pythonhosted.org/packages/cd/2e/2051f5c772f4dfc0aae3741d5fc72c3dcfe3aaeb461cc231668a4db1ce14/zstandard-0.23.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:12a289832e520c6bd4dcaad68e944b86da3bad0d339ef7989fb7e88f92e96072", size = 5306545 }, - { url = "https://files.pythonhosted.org/packages/0a/9e/a11c97b087f89cab030fa71206963090d2fecd8eb83e67bb8f3ffb84c024/zstandard-0.23.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d50d31bfedd53a928fed6707b15a8dbeef011bb6366297cc435accc888b27c20", size = 5337533 }, - { url = "https://files.pythonhosted.org/packages/fc/79/edeb217c57fe1bf16d890aa91a1c2c96b28c07b46afed54a5dcf310c3f6f/zstandard-0.23.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:72c68dda124a1a138340fb62fa21b9bf4848437d9ca60bd35db36f2d3345f373", size = 5436510 }, - { url = "https://files.pythonhosted.org/packages/81/4f/c21383d97cb7a422ddf1ae824b53ce4b51063d0eeb2afa757eb40804a8ef/zstandard-0.23.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:53dd9d5e3d29f95acd5de6802e909ada8d8d8cfa37a3ac64836f3bc4bc5512db", size = 4859973 }, - { url = "https://files.pythonhosted.org/packages/ab/15/08d22e87753304405ccac8be2493a495f529edd81d39a0870621462276ef/zstandard-0.23.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:6a41c120c3dbc0d81a8e8adc73312d668cd34acd7725f036992b1b72d22c1772", size = 4936968 }, - { url = "https://files.pythonhosted.org/packages/eb/fa/f3670a597949fe7dcf38119a39f7da49a8a84a6f0b1a2e46b2f71a0ab83f/zstandard-0.23.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:40b33d93c6eddf02d2c19f5773196068d875c41ca25730e8288e9b672897c105", size = 5467179 }, - { url = "https://files.pythonhosted.org/packages/4e/a9/dad2ab22020211e380adc477a1dbf9f109b1f8d94c614944843e20dc2a99/zstandard-0.23.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:9206649ec587e6b02bd124fb7799b86cddec350f6f6c14bc82a2b70183e708ba", size = 4848577 }, - { url = "https://files.pythonhosted.org/packages/08/03/dd28b4484b0770f1e23478413e01bee476ae8227bbc81561f9c329e12564/zstandard-0.23.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:76e79bc28a65f467e0409098fa2c4376931fd3207fbeb6b956c7c476d53746dd", size = 4693899 }, - { url = "https://files.pythonhosted.org/packages/2b/64/3da7497eb635d025841e958bcd66a86117ae320c3b14b0ae86e9e8627518/zstandard-0.23.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:66b689c107857eceabf2cf3d3fc699c3c0fe8ccd18df2219d978c0283e4c508a", size = 5199964 }, - { url = "https://files.pythonhosted.org/packages/43/a4/d82decbab158a0e8a6ebb7fc98bc4d903266bce85b6e9aaedea1d288338c/zstandard-0.23.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:9c236e635582742fee16603042553d276cca506e824fa2e6489db04039521e90", size = 5655398 }, - { url = "https://files.pythonhosted.org/packages/f2/61/ac78a1263bc83a5cf29e7458b77a568eda5a8f81980691bbc6eb6a0d45cc/zstandard-0.23.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a8fffdbd9d1408006baaf02f1068d7dd1f016c6bcb7538682622c556e7b68e35", size = 5191313 }, - { url = "https://files.pythonhosted.org/packages/e7/54/967c478314e16af5baf849b6ee9d6ea724ae5b100eb506011f045d3d4e16/zstandard-0.23.0-cp312-cp312-win32.whl", hash = "sha256:dc1d33abb8a0d754ea4763bad944fd965d3d95b5baef6b121c0c9013eaf1907d", size = 430877 }, - { url = "https://files.pythonhosted.org/packages/75/37/872d74bd7739639c4553bf94c84af7d54d8211b626b352bc57f0fd8d1e3f/zstandard-0.23.0-cp312-cp312-win_amd64.whl", hash = "sha256:64585e1dba664dc67c7cdabd56c1e5685233fbb1fc1966cfba2a340ec0dfff7b", size = 495595 }, - { url = "https://files.pythonhosted.org/packages/80/f1/8386f3f7c10261fe85fbc2c012fdb3d4db793b921c9abcc995d8da1b7a80/zstandard-0.23.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:576856e8594e6649aee06ddbfc738fec6a834f7c85bf7cadd1c53d4a58186ef9", size = 788975 }, - { url = "https://files.pythonhosted.org/packages/16/e8/cbf01077550b3e5dc86089035ff8f6fbbb312bc0983757c2d1117ebba242/zstandard-0.23.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:38302b78a850ff82656beaddeb0bb989a0322a8bbb1bf1ab10c17506681d772a", size = 633448 }, - { url = "https://files.pythonhosted.org/packages/06/27/4a1b4c267c29a464a161aeb2589aff212b4db653a1d96bffe3598f3f0d22/zstandard-0.23.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d2240ddc86b74966c34554c49d00eaafa8200a18d3a5b6ffbf7da63b11d74ee2", size = 4945269 }, - { url = "https://files.pythonhosted.org/packages/7c/64/d99261cc57afd9ae65b707e38045ed8269fbdae73544fd2e4a4d50d0ed83/zstandard-0.23.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2ef230a8fd217a2015bc91b74f6b3b7d6522ba48be29ad4ea0ca3a3775bf7dd5", size = 5306228 }, - { url = "https://files.pythonhosted.org/packages/7a/cf/27b74c6f22541f0263016a0fd6369b1b7818941de639215c84e4e94b2a1c/zstandard-0.23.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:774d45b1fac1461f48698a9d4b5fa19a69d47ece02fa469825b442263f04021f", size = 5336891 }, - { url = "https://files.pythonhosted.org/packages/fa/18/89ac62eac46b69948bf35fcd90d37103f38722968e2981f752d69081ec4d/zstandard-0.23.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f77fa49079891a4aab203d0b1744acc85577ed16d767b52fc089d83faf8d8ed", size = 5436310 }, - { url = "https://files.pythonhosted.org/packages/a8/a8/5ca5328ee568a873f5118d5b5f70d1f36c6387716efe2e369010289a5738/zstandard-0.23.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ac184f87ff521f4840e6ea0b10c0ec90c6b1dcd0bad2f1e4a9a1b4fa177982ea", size = 4859912 }, - { url = "https://files.pythonhosted.org/packages/ea/ca/3781059c95fd0868658b1cf0440edd832b942f84ae60685d0cfdb808bca1/zstandard-0.23.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:c363b53e257246a954ebc7c488304b5592b9c53fbe74d03bc1c64dda153fb847", size = 4936946 }, - { url = "https://files.pythonhosted.org/packages/ce/11/41a58986f809532742c2b832c53b74ba0e0a5dae7e8ab4642bf5876f35de/zstandard-0.23.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:e7792606d606c8df5277c32ccb58f29b9b8603bf83b48639b7aedf6df4fe8171", size = 5466994 }, - { url = "https://files.pythonhosted.org/packages/83/e3/97d84fe95edd38d7053af05159465d298c8b20cebe9ccb3d26783faa9094/zstandard-0.23.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a0817825b900fcd43ac5d05b8b3079937073d2b1ff9cf89427590718b70dd840", size = 4848681 }, - { url = "https://files.pythonhosted.org/packages/6e/99/cb1e63e931de15c88af26085e3f2d9af9ce53ccafac73b6e48418fd5a6e6/zstandard-0.23.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:9da6bc32faac9a293ddfdcb9108d4b20416219461e4ec64dfea8383cac186690", size = 4694239 }, - { url = "https://files.pythonhosted.org/packages/ab/50/b1e703016eebbc6501fc92f34db7b1c68e54e567ef39e6e59cf5fb6f2ec0/zstandard-0.23.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:fd7699e8fd9969f455ef2926221e0233f81a2542921471382e77a9e2f2b57f4b", size = 5200149 }, - { url = "https://files.pythonhosted.org/packages/aa/e0/932388630aaba70197c78bdb10cce2c91fae01a7e553b76ce85471aec690/zstandard-0.23.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:d477ed829077cd945b01fc3115edd132c47e6540ddcd96ca169facff28173057", size = 5655392 }, - { url = "https://files.pythonhosted.org/packages/02/90/2633473864f67a15526324b007a9f96c96f56d5f32ef2a56cc12f9548723/zstandard-0.23.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:fa6ce8b52c5987b3e34d5674b0ab529a4602b632ebab0a93b07bfb4dfc8f8a33", size = 5191299 }, - { url = "https://files.pythonhosted.org/packages/b0/4c/315ca5c32da7e2dc3455f3b2caee5c8c2246074a61aac6ec3378a97b7136/zstandard-0.23.0-cp313-cp313-win32.whl", hash = "sha256:a9b07268d0c3ca5c170a385a0ab9fb7fdd9f5fd866be004c4ea39e44edce47dd", size = 430862 }, - { url = "https://files.pythonhosted.org/packages/a2/bf/c6aaba098e2d04781e8f4f7c0ba3c7aa73d00e4c436bcc0cf059a66691d1/zstandard-0.23.0-cp313-cp313-win_amd64.whl", hash = "sha256:f3513916e8c645d0610815c257cbfd3242adfd5c4cfa78be514e5a3ebb42a41b", size = 495578 }, -]