Giter Club home page Giter Club logo

examples's Introduction

Node.js Examples

This repository is a collective of opinionated and real-world examples of how you can use Node.js to build things.

How This Repository is Structured

This repository is structured in a specific way:

  • Top-level directories are category directories of applications - for example CLI, server, and utility - that enable you to find the specific kind of example you're looking for.
  • Second-level directories are project directories named after specific modules, frameworks, platforms, or tools - for example, yargs is a CLI framework, both express and fastify are web frameworks, and moment is a utility.
  • Third-level directories are example directories, where specific examples live. You can find a full list of these examples in the Examples section below.

Here is an example of the structure in general terms:

- examples (root)
  - category
    - project
      - example
  - category
    - project
      - example
      - example
      - example
    - project
      - example
      - example
  - category
    - project
      - example
    - project
      - example
      - example

Each example has a few properties (if one doesn't, please let us know):

  • Usable example code.
  • Passing tests.
  • A README.md that explains what the example does and how to use it.

Examples

CLI

Command Line Interfaces (CLIs) are tools that can be accessed exclusively from the command line that generally serve some utility. There is a vibrant community of Node.js CLI utilities, ranging from packages to make it slightly easier to accomplish something to full frameworks for building CLI experiences.

  • CLI
    • yargs
      • countEntriesInDirectory: A small command line tool that shows how to use yargs and Node.js together, leveraging Node.js's path and fs modules to read a directory passed by the CLI user

Contributing

We've documented how to meaningfully contribute in CONTRIBUTING.md 🤗

Thank You To Our Contributors

We use All Contributors for this section of the README. Please ensure you have the all-contributors-cli installed if you're modifying it. See the All Contributors CLI Usage documentation for details on usage. See the emoji key for details on what each emoji represents.


Tierney Cyren

💻 🖋 📖 ⚠️

Matteo Collina

🚇 🤔

Thiru

💡 🚧

examples's People

Contributors

bnb avatar mcollina avatar thiruppathi 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

examples's Issues

wishlist: Express examples

It would be genuinely wonderful to get some examples of Express into the examples repo's servers examples.

Ideally, these examples will:

  • Go beyond a simple "Hello, World"
  • Include tests
  • Have a README that explains what the project does and how to use it.

Please see CONTRIBUTING.md for more context on how to contribute. Please feel free to ask any questions here ❤️

move to strict categories and create examples for them

per a discussion with @codebytere and extending a discussion with @joesepi, before we start sharing this repository more widely we should populate it with more examples.

some points that have come up:

  • instead of allowing freeform categories, we should have more rigid categories that don't necessarily leave the option of creating categories up to contributors
    • in doing this, we should definitely have examples in the categories rather than having them be empty
    • we should probably work on the categories and figure out who'd be willing/able to add things to them

additionally, this will mean the README.md needs to be updated to effectively reflect limited categories

wishlist: IBM Cloud Functions examples

It would be genuinely wonderful to get some examples of IBM Cloud Functions into the examples repo's cloud examples.

Ideally, these examples will:

  • Go beyond a simple "Hello, World"
  • Include tests
  • Have a README that explains what the project does and how to use it.

Please see CONTRIBUTING.md for more context on how to contribute. Please feel free to ask any questions here ❤️

wishlist: AWS Lambda examples

It would be genuinely wonderful to get some examples of AWS Lambda into the examples repo's cloud examples.

Ideally, these examples will:

  • Go beyond a simple "Hello, World"
  • Include tests
  • Have a README that explains what the project does and how to use it.

Please see CONTRIBUTING.md for more context on how to contribute. Please feel free to ask any questions here ❤️

wishlist: Fastify Examples

It would be genuinely wonderful to get some examples of Fastify into the examples repo's servers examples.

Ideally, these examples will:

  • Go beyond a simple "Hello, World"
  • Include tests
  • Have a README that explains what the project does and how to use it.

Please see CONTRIBUTING.md for more context on how to contribute. Please feel free to ask any questions here ❤️

wishlist: Google Cloud Functions examples

It would be genuinely wonderful to get some examples of Google Cloud Functions into the examples repo's cloud examples.

Ideally, these examples will:

  • Go beyond a simple "Hello, World"
  • Include tests
  • Have a README that explains what the project does and how to use it.

Please see CONTRIBUTING.md for more context on how to contribute. Please feel free to ask any questions here ❤️

wishlist: Azure Functions examples

It would be genuinely wonderful to get some examples of Azure Functions into the examples repo's cloud examples.

Ideally, these examples will:

  • Go beyond a simple "Hello, World"
  • Include tests
  • Have a README that explains what the project does and how to use it.

Please see CONTRIBUTING.md for more context on how to contribute. Please feel free to ask any questions here ❤️

[WIP] Global wishlist

With the discussions during the OpenJS world event in Vancouver, a lot of people express the interest / need to have both documentation and examples being easy to use by the broader community.
Here is a quick list of some first ideas (I will open a PR to have some kind of summary inside the repo)

In all case each item should include

  • test
  • how to use (full step by step)
  • explanation or consideration

Pure Node.js

  • Node.js test platform: runner, test, tap output...
  • Stream operation (pipeline, duplex, transform)
  • Read / write files with transformation (buffer operation?)
  • Simple HTTP server
  • Node-api with c/c++ wrapper
  • Node-api with napi-rs / bindgen / neon for rust
  • Loader (use case with typescript? waiting to move out of experimental?)
  • CLI usage (read args, interacting with systems)
  • Undici / HTTP use case

NPM / Packages

  • Create a simple package and publishing it
  • Build CJS / ESM dual package
  • NPM query and usage of NPM CLI

TypeScript

  • Using Typescript to create a package / lib

Cloud

  • Serverless function for all providers (read a request, insert into a db for each)
  • Docker setup for a project

TypeScript

  • Setup a basic example with typescript
  • Full TS + HMR setup for project
  • How to use map files

Other

  • Docker base application
  • Security solution
  • Good practice (?)

wishlist: Commander examples

It would be genuinely wonderful to get some examples of Commander into the examples repo's cli examples.

Ideally, these examples will:

  • Go beyond a simple "Hello, World"
  • Include tests
  • Have a README that explains what the project does and how to use it.

Please see CONTRIBUTING.md for more context on how to contribute. Please feel free to ask any questions here ❤️

wishlist: Electron examples

It would be genuinely wonderful to get some examples of Electron into the examples repo's applications examples.

Ideally, these examples will:

  • Go beyond a simple "Hello, World"
  • Include tests
  • Have a README that explains what the project does and how to use it.

Please see CONTRIBUTING.md for more context on how to contribute. Please feel free to ask any questions here ❤️

"Conditional" actions running on all PRs

Theoretically, both cli-yargs-countentriesindirectory.yaml and servers-express-api-with-express-and-handlebars.yaml should only be running on PRs against their respective projects because of this YAML (this specific example is from the GitHub Action for Express's YAML):

on:
  push:
    paths:
      - 'servers/express/api-with-express-and-handlebars/**'
  pull_request:
    paths:
      - 'servers/express/api-with-express-and-handlebars/**'

However, they're currently running on all PRs, which is incorrect.

According to the GitHub Actions Documentation, this should work (example from the docs):

on:
  push:
    paths:
    - '**.js'

I can't tell if I'm missing something or if this feature of GitHub Actions CI is broken, and I honestly can't tell what next steps are to figure that out. That said, with how this project is structured we either need to answer that and find a fix or change how we do CI within GitHub Actions.

wishlist: Heroku examples

It would be genuinely wonderful to get some examples of Heroku into the examples repo's cloud examples.

Ideally, these examples will:

  • Go beyond a simple "Hello, World"
  • Include tests
  • Have a README that explains what the project does and how to use it.

Please see CONTRIBUTING.md for more context on how to contribute. Please feel free to ask any questions here ❤️

wishlist: Google Cloud Run examples

It would be genuinely wonderful to get some examples of Google Cloud Run into the examples repo's cloud examples.

Ideally, these examples will:

  • Go beyond a simple "Hello, World"
  • Include tests
  • Have a README that explains what the project does and how to use it.

Please see CONTRIBUTING.md for more context on how to contribute. Please feel free to ask any questions here ❤️

fake-names-generator : Names generated in console are different from ones saved in file

Thanks for this repository, I'm learning NodeJs and this helps me.

Issue

I think there is a small issue in project cli/commander/fake-names-generator.
When we choose to save the names, the display names are different than the one shown in the console.

RootCause

I think the issue come from logNames() and saveNames() that generate two times the names in cli\commander\fake-names-generator\bin\cli.js.

Possible solution

logNames() could return the generated names and pass it to saveNames().

wishlist: Netlify Functions examples

It would be genuinely wonderful to get some examples of Netlify Functions into the examples repo's cloud examples.

Ideally, these examples will:

  • Go beyond a simple "Hello, World"
  • Include tests
  • Have a README that explains what the project does and how to use it.

Please see CONTRIBUTING.md for more context on how to contribute. Please feel free to ask any questions here ❤️

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.