npm/publish-wiki.js
function (next) {
            var source = fs.readFileSync(path.join('out', 'wiki', 'REFERENCE.md')).toString(),
                home,
                sidebar;

            // extract sidebar from source
            sidebar = source.replace(/<a name="Collection"><\/a>[\s\S]+/g, '');

            // remove sidebar data from home
            home = source.substr(sidebar.length);

            // add timestamp to sidebar
            sidebar += '\n\n ' + (new Date()).toUTCString();

            async.each([{
                path: path.join('.tmp', 'github-wiki', '_Sidebar.md'),
                data: sidebar
            }, {
                path: path.join('.tmp', 'github-wiki', 'Home.md'),
                data: home
            }], function (opts, next) {
                fs.writeFile(opts.path, opts.data, next);
            }, next);
        }
function (next) {
            var source = fs.readFileSync(path.join('out', 'wiki', 'REFERENCE.md')).toString(),
                home,
                sidebar;

            // extract sidebar from source
            sidebar = source.replace(/<a name="Collection"><\/a>[\s\S]+/g, '');

            // remove sidebar data from home
            home = source.substr(sidebar.length);

            // add timestamp to sidebar
            sidebar += '\n\n ' + (new Date()).toUTCString();

            async.each([{
                path: path.join('.tmp', 'github-wiki', '_Sidebar.md'),
                data: sidebar
            }, {
                path: path.join('.tmp', 'github-wiki', 'Home.md'),
                data: home
            }], function (opts, next) {
                fs.writeFile(opts.path, opts.data, next);
            }, next);
        }
function ( next ) { var source = fs . readFileSync ( path . join ( 'out' , 'wiki' , 'REFERENCE.md' ) ) . toString ( ) , home , sidebar ; // extract sidebar from source sidebar = source . replace ( / <a name="Collection"><\/a>[\s\S]+ / g , '' ) ; // remove sidebar data from home home = source . substr ( sidebar . length ) ; // add timestamp to sidebar sidebar += '\n\n ' + ( new Date ( ) ) . toUTCString ( ) ; async . each ( [ { path : path . join ( '.tmp' , 'github-wiki' , '_Sidebar.md' ) , data : sidebar } , { path : path . join ( '.tmp' , 'github-wiki' , 'Home.md' ) , data : home } ] , function ( opts , next ) { fs . writeFile ( opts . path , opts . data , next ) ; } , next ) ; }
update contents of repository
update contents of repository