io.js

const vs let when calling require

有些话、适合烂在心里 提交于 2019-12-02 17:53:44
As io.js now supports ES6 you are finally able to use the const and let keywords. Obviously, let is the successor of var , just with some super-powers. But what about const ? I know, of course, what "constant" means, but I was wondering when to use it (regarding best practices). E.g., if I create a module that requires another module, I could write: 'use strict'; const util = require('util'); const foo = function () { // Do something with util }; module.exports = foo; Basically I've replaced every occurence of var with const . Generally speaking, I think that this is okay, but if I follow this

ReactNative: Android与iOS平台兼容处理

早过忘川 提交于 2019-11-30 10:01:55
方法一: 创建不同的文件扩展名: *.android.js *.io.js 方法二: import { Platform } from 'react-native'; if (Platform.OS === 'android') { // Do something specific for Android } else if (Platform.OS === 'ios') { // Handle iOS } marginTop: Platform.OS === 'ios' 10 : 0, paddingBottom: Platform.OS === 'android' 8 : 0 方法三: const myStyle = Platform.select({ios:{},android:{}) const myFn = Platform.select({ios:()=>{},android:()=>{}) myFn(); 方法四: if (UIManager.setLayoutAnimationEnabledExperimental) { UIManager.setLayoutAnimationEnabledExperimental(true); } 来源: oschina 链接: https://my.oschina.net/u/4225199/blog/3135188

What is the suggested way to install brew, node.js, io.js, nvm, npm on OS X?

南楼画角 提交于 2019-11-27 05:44:57
I am trying to use homebrew as much as possible. What's the suggested way to install the following on OS X? node.js io.js nvm npm and hopefully supports development for: ionic ngCordova Using homebrew install nvm : brew update brew install nvm source $(brew --prefix nvm)/nvm.sh Add the last command to the .profile , .bashrc or .zshrc file to not run it again on every terminal start. So for example to add it to the .profile run: echo "source $(brew --prefix nvm)/nvm.sh" >> ~/.profile If you have trouble with installing nvm using brew you can install it manually (see here ) Using nvm install

What is the suggested way to install brew, node.js, io.js, nvm, npm on OS X?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 12:49:46
问题 I am trying to use homebrew as much as possible. What\'s the suggested way to install the following on OS X? node.js io.js nvm npm and hopefully supports development for: ionic ngCordova 回答1: Using homebrew install nvm : brew update brew install nvm source $(brew --prefix nvm)/nvm.sh Add the last command to the .profile , .bashrc or .zshrc file to not run it again on every terminal start. So for example to add it to the .profile run: echo "source $(brew --prefix nvm)/nvm.sh" >> ~/.profile If