Skip to content

Commit

Permalink
Added CallbackInsanity Demo 4
Browse files Browse the repository at this point in the history
  • Loading branch information
sayar committed Oct 14, 2014
1 parent bfc4bc0 commit c77272c
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ ClientBin/
*.pfx
*.publishsettings
node_modules/
.ntvs_analysis.dat

# RIA/Silverlight projects
Generated_Code/
Expand Down Expand Up @@ -256,4 +257,4 @@ build/Release
node_modules

# Users Environment Variables
.lock-wscript
.lock-wscript
Expand Down
37 changes: 37 additions & 0 deletions 04_CallbackInsanity/04_CallbackInsanity.njsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<Name>04_CallbackInsanity</Name>
<RootNamespace>04_CallbackInsanity</RootNamespace>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>780776b3-8fb7-4558-a597-17a630221a24</ProjectGuid>
<ProjectHome>.</ProjectHome>
<StartupFile>app.js</StartupFile>
<StartWebBrowser>False</StartWebBrowser>
<SearchPath>
</SearchPath>
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<ProjectTypeGuids>{3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}</ProjectTypeGuids>
<ProjectView>ShowAllFiles</ProjectView>
<StartWebBrowser>false</StartWebBrowser>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<Compile Include="app.js" />
<Content Include="package.json" />
</ItemGroup>
<Import Project="$(VSToolsPath)\Node.js Tools\Microsoft.NodejsTools.targets" />
</Project>
17 changes: 17 additions & 0 deletions 04_CallbackInsanity/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var fs = require('fs');

fs.readdir('.', function (err, files) {
if (err) {
console.log('Error finding files: ' + err)
} else {
files.forEach(function (filename, fileIndex) {
fs.readFile(filename, function (err, buf) {
if (err) {
console.log('Error reading file:' + err);
} else {
console.log(buf.toString());
}
});
});
}
});
10 changes: 10 additions & 0 deletions 04_CallbackInsanity/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "_04_CallbackInsanity",
"version": "0.0.0",
"description": "04_CallbackInsanity",
"main": "app.js",
"author": {
"name": "Rami Sayar",
"email": ""
}
}
6 changes: 6 additions & 0 deletions NodeMVA.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "02_HelloWorldHTTP", "02_Hel
EndProject
Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "03_FileIO", "03_FileIO\03_FileIO.njsproj", "{B2BA44EB-6DCE-4DEE-A2C7-1FCFDCCECA0A}"
EndProject
Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "04_CallbackInsanity", "04_CallbackInsanity\04_CallbackInsanity.njsproj", "{780776B3-8FB7-4558-A597-17A630221A24}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -33,6 +35,10 @@ Global
{B2BA44EB-6DCE-4DEE-A2C7-1FCFDCCECA0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2BA44EB-6DCE-4DEE-A2C7-1FCFDCCECA0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2BA44EB-6DCE-4DEE-A2C7-1FCFDCCECA0A}.Release|Any CPU.Build.0 = Release|Any CPU
{780776B3-8FB7-4558-A597-17A630221A24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{780776B3-8FB7-4558-A597-17A630221A24}.Debug|Any CPU.Build.0 = Debug|Any CPU
{780776B3-8FB7-4558-A597-17A630221A24}.Release|Any CPU.ActiveCfg = Release|Any CPU
{780776B3-8FB7-4558-A597-17A630221A24}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit c77272c

Please sign in to comment.