Permalink
Browse files

Add initial files from node-api

  • Loading branch information...
Jeffrey Horn
Jeffrey Horn committed Mar 7, 2016
0 parents commit a01a1d0c03cadb3e4ecdeba2aea39677114a25fb
Showing with 539 additions and 0 deletions.
  1. +13 −0 .editorconfig
  2. +99 −0 .gitignore
  3. +12 −0 .jscsrc
  4. +1 −0 .jshintignore
  5. +14 −0 .jshintrc
  6. +23 −0 .remarkrc
  7. +12 −0 Gruntfile.js
  8. +46 −0 LICENSE
  9. +66 −0 README.md
  10. +11 −0 example.json
  11. +3 −0 example.txt
  12. +6 −0 grunt/aliases.json
  13. +8 −0 grunt/jasmine.json
  14. +15 −0 grunt/jasmine_nodejs.json
  15. +21 −0 grunt/jscs.json
  16. +8 −0 grunt/jshint.json
  17. +5 −0 grunt/jsonlint.json
  18. +14 −0 grunt/node-inspector.json
  19. +29 −0 grunt/paths.json
  20. +42 −0 lib/copy-json.js
  21. +5 −0 lib/example.js
  22. +21 −0 lib/hey-yall.js
  23. +22 −0 lib/randomizer.js
  24. +11 −0 output.json
  25. +23 −0 package.json
  26. +9 −0 spec/example.spec.js
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
@@ -0,0 +1,99 @@

# Created by https://www.gitignore.io/api/node,osx,linux,windows

### Node ###
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
node_modules

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history


### OSX ###
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*


### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

12 .jscsrc
@@ -0,0 +1,12 @@
{
"preset": "airbnb",
"disallowMultipleVarDecl": "exceptUndefined",
"requirePaddingNewLinesAfterBlocks": {
"allExcept": ["inCallExpressions", "inArrayExpressions", "inProperties"]
},
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"validateIndentation": 2
}
@@ -0,0 +1 @@
node_modules
@@ -0,0 +1,14 @@
{
"curly": true,
"devel": true,
"eqeqeq": true,
"esversion": 6,
"jasmine": true,
"latedef": true,
"noarg": true,
"node": true,
"nonew": true,
"strict": "global",
"undef": true,
"unused": true
}
@@ -0,0 +1,23 @@
{
"plugins": {
"lint": {
"blockquote-indentation": "2",
"checkbox-character-style": {
"checked": "x",
"unchecked": " "
},
"code-block-style": "fenced",
"heading-style": "atx",
"list-item-spacing": false,
"no-html": false,
"no-shortcut-reference-link": true,
"no-undefined-references": true,
"ordered-list-marker-value": "one",
"rule-style": "---",
"unordered-list-marker-style": "-"
}
},
"settings": {
"commonmark": true
}
}
@@ -0,0 +1,12 @@
'use strict';

// http://ericnish.io/blog/how-to-neatly-separate-grunt-files
// http://www.html5rocks.com/en/tutorials/tooling/supercharging-your-gruntfile/
// discuss how to break up gruntfiles

module.exports = function(grunt) {

require('time-grunt')(grunt);
require('load-grunt-config')(grunt);

};
46 LICENSE
@@ -0,0 +1,46 @@
Source code distributed under the MIT license. Text and other assets copyright
General Assembly, Inc., all rights reserved.

--------------------------------------------------------------------------------

The MIT License

Copyright (c) 2015--2016 General Assembly, Inc. http://generalassemb.ly

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

--------------------------------------------------------------------------------

Copyright (c) 2015--2016 General Assembly, Inc. http://generalassemb.ly

All rights reserved. No part of this publication may be reproduced,
distributed, or transmitted in any form or by any means, including
photocopying, recording, or other electronic or mechanical methods, without the
prior written permission of the publisher, except in the case of brief
quotations embodied in critical reviews and certain other noncommercial uses
permitted by copyright law. For permission requests, write to the publisher,
addressed "Attention: Permissions Coordinator," at the address below.

GA New York City
902 Broadway, 4th Floor
New York, NY 10010
USA
+1 (917) 722-0237

--------------------------------------------------------------------------------
@@ -0,0 +1,66 @@
[![General Assembly Logo](https://camo.githubusercontent.com/1a91b05b8f4d44b5bbfb83abac2b0996d8e26c92/687474703a2f2f692e696d6775722e636f6d2f6b6538555354712e706e67)](https://generalassemb.ly/education/web-development-immersive)

# Introduction to the Node API

## Prerequisites

- Familiarity with JavaScript as a language.
- Familiarity with JavaScript in the browser environment.

## Objectives

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

- Reference the Node API documentation for using JavaScript outside the
browser.
- Reference the MDN JavaScript documentation for JavaScript language features.
- Write a Node script using the File System API.

## Preparation

1. [Fork and clone](https://github.com/ga-wdi-boston/meta/wiki/ForkAndClone)
this repository.
1. Install dependencies with `npm install`.

## JavaScript, the Browser, and Node

- JavaScript: a language specified by ECMA and implemented independently
- Browser: an environment for running JavaScript (among other things)
- Node: an environment for running JavaScript outside the browser

How are the two environments similar? How do they differ?

## Lab: Research the File System API

Take a few minutes to read the following API documentation for the Node File
System module.

While you're reading, imagine how you'd use each function. Write some example
code in your notebook. Try to explain what each function does in your own words,
including what sorts of arguments it takes and each argument's type.

If you finish early, look for other interesting functions in the File System
module.

1. [`fs.readdir(path, callback)`](https://nodejs.org/dist/latest-v4.x/docs/api/fs.html#fs_fs_readdir_path_callback)
1. [`fs.readdirSync(path)`](https://nodejs.org/dist/latest-v4.x/docs/api/fs.html#fs_fs_readdirsync_path)
1. [`fs.readFile(file[, options], callback)`](https://nodejs.org/dist/latest-v4.x/docs/api/fs.html#fs_fs_readfile_file_options_callback)
1. [`fs.writeFile(file, data[, options], callback)`](https://nodejs.org/dist/latest-v4.x/docs/api/fs.html#fs_fs_writefile_file_data_options_callback)

## Read-Along: `copy-json.js`

## Code-Along: `hey-yall.js`

## Lab: Write a Randomizer

## Additional Resources

- [Docs | Node.js](https://nodejs.org/en/docs/)
- [JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
- [Node Courses from CodeSchool](https://www.codeschool.com/search?query=Node.js)
- [NodeSchool](http://nodeschool.io/)

## [License](LICENSE)

Source code distributed under the MIT license. Text and other assets copyright
General Assembly, Inc., all rights reserved.
@@ -0,0 +1,11 @@
{
"user": {
"email": "an@example.email",
"password": "example password",
"password_confirmation": "example password",
"person": {
"name": "Jane Doe",
"born_on": "1970-01-01"
}
}
}
@@ -0,0 +1,3 @@
Billy
James
Nick
@@ -0,0 +1,6 @@
{
"default": ["nag"],
"nag": ["jshint", "jsonlint:all", "jscs:status"],
"reformat": ["jscs:write"],
"test": ["jasmine_nodejs:test"]
}
@@ -0,0 +1,8 @@
{
"tests": {
"src": ["vendor.bundle.js", "bundle.js"],
"options": {
"specs": "specs.js"
}
}
}
@@ -0,0 +1,15 @@
{
"options": {
"specNameSuffix": "spec.js",
"stopOnFailure": false,
"reporters": {
"console": {
"verbosity": 3
}
}
},

"test": {
"specs": ["<%= paths.src.spec %> "]
}
}
@@ -0,0 +1,21 @@
{
"options": {
"config": ".jscsrc",
"esnext": true,
"verbose": true
},

"status": {
"src": ["<%= paths.src.all %>"],
"options": {
"force": true
}
},

"write": {
"src": ["<%= paths.src.all %>"],
"options": {
"fix": true
}
}
}
@@ -0,0 +1,8 @@
{
"all": {
"src": ["<%= paths.src.all %>"]
},
"options": {
"jshintrc": true
}
}
@@ -0,0 +1,5 @@
{
"all": {
"src": ["<%= paths.json.all %>"]
}
}
@@ -0,0 +1,14 @@
{
"debug": {
"options": {
"web-port": 8080,
"web-host": "localhost",
"debug-port": 5858,
"save-live-edit": true,
"stack-trace-limit": 20,
"hidden": [
"node_modules"
]
}
}
}
Oops, something went wrong.

0 comments on commit a01a1d0

Please sign in to comment.