Giter Club home page Giter Club logo

node-npm-practice's Introduction

General Assembly Logo

Using NPM with Node

Prerequisites

Objectives

By the end of this, developers should be able to:

  • Find an NPM package that solves a common problem.
  • Write a script that uses an NPM package.

Preparation

  1. Fork and clone this repository.
  2. Install dependencies with npm install.

Instructions

Read through each section, complete each lab, and submit answers in lib/practice.md via pull request.

Node and NPM

Node Modules

Node modules are simply packaged up pieces of code that assist us in various ways. Any functions exported by that module become available to us when we require said module. Variables local to the module's code remain private.

NPM

NPM is Node's default package manager. Not only does it allow developers to share their open source packages, but it allows us to download and keep updated with these packages.

Practice: Install a Package for Enumeration

Thinking back to Ruby, we know that as a language, it is really convenient for list processing versus JavaScript. How can we do something similar in Node?

Do some research and find a Node module that is designed to help with list processing/enumeration. Once you've found one you've deemed worthy, install it to this repository by running (from the command line)

npm install --save <package-name>

In your lib/practice.md, please make note of which package you decided on.

Research: Popular NPM Packages

Find the most popular packages on NPM and note, in your own words, three of the packages. Questions to consider while you research:

  1. What problem does this package solve?
  2. How can I use this package in my own code? What steps are involved?
  3. How well-maintained is this package? What criteria did I use to decide?

Please leave these responses in lib/practice.md.

Lab: Use Packages in randomizer.js

Take your randomizer script from ga-wdi-boston/node-api. Change it to use packages from NPM. You will need to identify what code you want to replace with a package and then find an appropriate package using Google or the NPM registry.

If the enumeration package you previously installed was not lodash, please go ahead and install lodash using npm install --save lodash

Here are a few things you might try:

  • Use lodash to iterate through collections.
  • Find a randomizer package to randomly sort an array.
  • Find a package to colorize terminal output and make your output pretty.
  • Decorate your output with emojis!

Useful NPM Packages

Careful when using packages in your font-end projects. Some of them are very large!

Additional Resources

  1. All content is licensed under a CC­BY­NC­SA 4.0 license.
  2. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact [email protected].

node-npm-practice's People

Contributors

bengitscode avatar laurenfazah avatar micfin avatar

Watchers

 avatar  avatar  avatar

node-npm-practice's Issues

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.