Code Monkey home page Code Monkey logo

lab-01-node-ecosystem's Introduction

CF 401 JS -- Class 01 node ecosystem

Submission Instructions

  • Work in a fork of this repository
  • Work in a branch on your fork
  • Write all of your code in a directory named lab- + <your name> e.g. lab-duncan
  • Submit a pull request to this repository
  • Submit a link to your pull request on canvas
  • Submit a question, observation, and how long you spent on canvas

Learning Objectives

  • Students will be able to set up a directory for creating an npm package
  • Students will be able to create and use CommonJS modules
  • Students will be able to write synchronous unit tests

Resources

Requirements

Configuration

Your lab directory must include

  • README.md -- with a documentation about your lab
  • .gitignore -- with a robust gitignore
  • .eslintrc -- with the class .eslintrc file
  • .eslintignore -- with the class .eslintignore
  • .package.json -- with all dependencies and dev-dependencies
  • lib/ -- a lib direcotry for holding your modules
  • test/ -- a test directory for holding your unit tests

Feature Tasks

  • Create a nodejs module named greet.js that exports a single function
  • The greet function should have a single parameter name that should expect a string
  • The greet function should return the input name concatenated with "Hello, "
  • The greet function should return null if the input is not a string
  • Create a nodejs module named arithmetic
  • The arithmetic.js module should have add and sub methods
  • add should have to params that should expect a number, it should return the sum of the to numbers
  • sub should have to params that should expect a number, it should return the first argument minus the second argument
  • decide on an expected behavior for non number inputs

Testing

  • Write a test the expects the greet module to return "Hello, world!" when invoked with "world!" as a parameter
  • Write a test that expects the greet module to return null when you use non string values
  • Write test for the add and subtract methods on the arithmetic module
  • Write a test that ensures the functions work as you expect with number inputs
  • Write a test that ensures the functions work as expected with non number inputs

Documentation

  • Write a description of your project in your README.md
BONUS 1pt
  • Write a test for the index.js CLI

Rubric

  • 2pts Configuration
  • 3pts Feature Tasks
  • 3pts Tests
  • 2pts Documentation

lab-01-node-ecosystem's People

Contributors

slugbyte avatar

Watchers

James Cloos avatar

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.