Giter Site home page Giter Site logo

microsoftdocs / node-essentials Goto Github PK

View Code? Open in Web Editor NEW
104.0 20.0 143.0 845 KB

MS Learn Node Essentials sample code

Home Page: https://learn.microsoft.com/training/paths/build-javascript-applications-nodejs/

License: Creative Commons Attribution 4.0 International

Shell 1.92% JavaScript 98.08%
azure javascript microsoft-learn nodejs npm tutorial tutorial-exercises

node-essentials's Introduction

page_type name languages products
sample
Build JavaScript applications with Node.js
javascript
azure
vs-code

Node essentials

Open in GitHub Codespaces

Node.Js Learn Path

This repository contains the source code for tutorials proposed in the Node.js Learning Path and the Beginner's video Series to Node.js.

🎯 Overview

Learning any new technology is a time-consuming process where it's easy to get lost. This is why we created this series of practical, and focused modules about Node.js for beginners so you can get up to speed.

You'll find all the source code used in the Learn modules and videos to help you during your learning journey.

The full banking API source code shown in the Express videos can be found here: WebDev for Beginners - Bank project

And if you need to learn or improve your JavaScript skills, take a look at the Beginner's video Series to JavaScript.

📚 Next steps

Because learning is a never-ending journey, we want to help you as much as we can to get you ready for what's coming next. You'll find here a great collection of resources you can use to build your knowledge.

💻 Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

⚖️Legal Notices

Microsoft and any contributors grant you a license to the Microsoft documentation and other content in this repository under the Creative Commons Attribution 4.0 International Public License, see the LICENSE file, and grant you a license to any code in the repository under the MIT License, see the LICENSE-CODE file.

Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.

Privacy information can be found at https://privacy.microsoft.com/en-us/

Microsoft and any contributors reserve all other rights, whether under their respective copyrights, patents, or trademarks, whether by implication, estoppel or otherwise.

node-essentials's People

Contributors

dependabot[bot] avatar diberry avatar glaucia86 avatar jvilomar avatar microsoft-github-operations[bot] avatar microsoftopensource avatar nickwalkmsft avatar qqqys avatar romain-koenig avatar sagartyagi121 avatar shannonleavitt avatar sinedied avatar softchris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-essentials's Issues

File System example error

Code provided raises the following syntax error:

const items = await fs.readdir("stores");
              ^^^^^

SyntaxError: await is only valid in async functions and the top level bodies of modules

Code:

const fs = require("fs").promises;

const items = await fs.readdir("stores");
console.log(items);

Best practice for updates

Is this correct?

The recommended workflow for updates is:

  1. Verify your existing tests pass before starting this update process.
  2. npm audit: to check for vulnerabilities in the current version you are using.
  3. npm outdated: to list all the outdated packages. This command provides information in the Wanted, Latest, and Location columns.
  4. The information from npm audit may recommend updating to a major version. You should carefully review the breaking changes if any are listed.
  5. Update the version:
    • npm update <optional package name>: to update the installed packages. If you run this command with a package name specified, the command tries to update only the specified package. If you don't specify a package, the command tries to update all the packages in the package.json file.
    • npm audit fix --force: this command updates the major version of the package. This command can introduce breaking changes. Use this command only if you're aware of the breaking changes and are ready to update your code to accommodate them.
  6. Verify your tests pass after the update.

Missing `client-delete-route.js` from repo

In step 5 of the Route management lesson there is a reference to 'client-delete-route.js'. This file does not appear to exist within the repo which makes it impossible to complete the tasks on that step.

Here is the page that has the reference:

https://docs.microsoft.com/en-us/learn/modules/build-web-api-nodejs-express/5-exercise-route-management

And the path to where the file should exist:

/node-essentials/node-dependencies/8-express-app/node-essentials/nodejs-http/exercise-express-routing/reading-writing/client-delete-route.js

Recommended code for exercise doesn't work

The code provided for app.delete on Exercise - Route management -> Implement support for reading and writing data -> 7. will not work with the files provided. Recommend changing to:

app.delete('/products', function(req, res) {
  const deletedProduct = products.find(p => p.id === +req.body.id);
  products = products.filter(p => p.id !== +req.body.id);
  res.json(deletedProduct);
});

Incorrect path.join in learning material

Typos at unit 6 Create files and directories at Work with files and directories in a Node.js app in learning material.

The Create files section is wrong. The example code says that the 3rd argument of path.join is the content of the file to be written to. That makes no sense as is incorrect. The text in the section that explains the core are incorrect too.
Example: await fs.writeFile(path.join(__dirname, "greeting.txt", "Hello World!"));
Should have been: await fs.writeFile(path.join(__dirname, "greeting.txt"), "Hello World!");

Trying to run the incorrect example code gives the following error:

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
    at Object.writeFile (node:internal/fs/promises:812:5)

Typo in NodeJS course

Hi,
I wanted to let you know there is a typo in the file system module, unit 3 where a function name is mistyped in step 3 of "Write a method to find the sales.json files"

It is written as

This new method findFiles is created inside the main findSalesMethod method so that it can run as many times as necessary to find all the sales files and populate the salesFiles array. The folderName value is the path to the current folder.

Instead it should be

This new method findFiles is created inside the main findSalesFiles method so that it can run as many times as necessary to find all the sales files and populate the salesFiles array. The folderName value is the path to the current folder.

Loom video link

Incorrect command "node.index.js" in learning material

Typos at unit 9 Exercise - Read and write to files at Work with files and directories in a Node.js app in learning material.

The Run the program section is wrong. Step 2 says to run the index.js file again, but the command is changed to node.index.js.
That should have been node index.js again as in step 1.

Trying to execute the incorrect commands gives the following error:
node.index.js : The term 'node.index.js' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:1 char:1

  • node.index.js
  •   + CategoryInfo          : ObjectNotFound: (node.index.js:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    

Also step 3 Select the index.js file makes no sense.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.