zoukankan      html  css  js  c++  java
  • nodejs document

    Class:Buffer

    .{Function}

    Used to handle binary data. See the buffer section

    require()

    to require modules,  require isn;t actually a blobal but rather local to each module.

    require.resolve()

    Use the internal require()    machinery to look up the location of a module ,but rather

    than loading the module ,,just return the resolved filename.

    require.cache

    object

    Modules are cached in this object when they are required..

    By deleting a key value from this object the next require will relodad the module.

    require.extensions

    Array

    Instruct require on how to handle certain file extensions.

    Process files with the extendion .sjs as .js

    require.extendions['.sjs'] = require.extensions['.js'];

    require.extensions['.sjs'] = function(module,filename) {

      var content = fs.readFileSync(filename,'utf8');

      module.exports = content;

    }

    __filename

    the filename of the code being executed.This is the resolved absolute path of this code file. For a main program this is not necessarily the same filename used in

    the command line  The value inside a module is the path to that module file

    __dirname

    The name of the directory that the current executing script resides in

    module

    {object}

    A reference to the current module .

    In  particular module.exports is the same as the exportts object.

    module isn;t actually a global but rather local to each module

    exports

    An object which is shared between all instances of the current module and made a

    module and made a accessible ghrough require().  exports is the same as the module.exports object  exports in

    setTimeout(cb,ms)

    Run callback cb after at least ms milliseconds The actual delay ddepends on extenernal factors like OS timer  granularyity and system load.

    in the range of 1-2137483647   inclusive

    a timer cannot span more than 24.8 days.

    Returns an opaque value that represents the timer.

    clearTimeout(t)

    Stop a timer that was previously created with setTimeout()...   The callack will not execute.

    setInterval(cb, ms)

    Run callback cb repeatedly every ms millseconds   vary,  depending on external

    clearInterval(t)

    console

    Stability

    For printing to stdout and stderr,  similar to the console object fuctions provided by most web browsers

    console.log([data],[...])

    prints to stdout with newline, this function can take multiple arguments in a printf

    console.log('count:%d',count);

    util.inspect

    console.info([data],[...])

    console.error([data],[...])

    console.warn

    console.dir(obj)

    console.time(label)

    console.timeEnd(label)

    console.time('100-elements');

    for(var i=0;i<100;i++) {

      ;

    }

    console.timeEnd('100-elements');

    console.trace(label)

    Print a stack trace to stderr of the current position.

    console.assert(expression,[message])

    Same as assert.ok  where if the expression evaluates as false throw as Assertion Error with message

    Timers

    Stability   Locked..

    All of the timer functions are globals

    setTimeout(callback,delay,[arg],[...])

    pass arguments to the callback.

    Modules

  • 相关阅读:
    js 修改 title keywords description
    添加第一次进入网站动画
    懒加载
    一些正则
    对图片进行剪切,保留原始比例
    JS判断是否是微信页面,判断手机操作系统(ios或android)并跳转到不同下载页面
    判断网页是否再微信内置浏览器打开
    数字转汉字大写
    java 反射机制 之 getConstructor获取有参数构造函数 然后newInstance执行有参数的构造函数
    web实训项目(快递e栈)-----04项目实现的基本流程
  • 原文地址:https://www.cnblogs.com/yushunwu/p/2775347.html
Copyright © 2011-2022 走看看