Skip to content

Instantly share code, notes, and snippets.

@Raincal
Created May 8, 2015 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raincal/e9947048198541c79100 to your computer and use it in GitHub Desktop.
Save Raincal/e9947048198541c79100 to your computer and use it in GitHub Desktop.
node
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="PROJECT" libraries="{Node.js v0.12.2 Core Modules}" />
<includedPredefinedLibrary name="ECMAScript 6" />
<includedPredefinedLibrary name="Node.js Globals" />
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Node.js v0.12.2 Core Modules" level="application" />
</component>
</module>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" />
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/learn-node.iml" filepath="$PROJECT_DIR$/.idea/learn-node.iml" />
</modules>
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="" />
</component>
</project>
/**
* Created by Yujia on 2015/5/8.
*/
console.log('This is a log.');
console.info('This is an info.');
console.warn('This is a warn.');
console.error('This is an error.');
console.time('time');
for(var i=0;i<1000000;i++){}
console.timeEnd('time');
This is a warn.
This is an error.
/**
* Created by Yujia on 2015/5/8.
*/
console.log(__dirname);
console.log(__filename);
/**
* Created by Yujia on 2015/5/8.
*/
console.log("Hello World!");
This is a log.
This is an info.
This is a warn.
This is an error.
/**
* Created by Yujia on 2015/5/9.
*/
process.stdout.write('This is stdout.');
process.stderr.write('This is stderr.');
process.stdin.setEncoding('utf-8');
/*
process.stdin.on('data',function(data){
console.log(data);
})*/
process.stdin.on('readable',function(){
var data = process.stdin.read();
console.log(data);
})
var sum = 0;
for(var i=0;i<=100;i++){
sum += i;
}
console.log(sum);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment