Skip to content

Instantly share code, notes, and snippets.

@wilmoore
Created February 17, 2014 00:40
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 wilmoore/9042767 to your computer and use it in GitHub Desktop.
Save wilmoore/9042767 to your computer and use it in GitHub Desktop.
requirebin sketch
var selectn = require('selectn');
var talk = {
info: { name: 'Go Ahead, Make a Mess' }
};
var talk = selectn('info.name', talk);
console.log(talk);
require=function e(r,n,t){function o(i,a){if(!n[i]){if(!r[i]){var f="function"==typeof require&&require;if(!a&&f)return f(i,!0);if(u)return u(i,!0);throw Error("Cannot find module '"+i+"'")}var l=n[i]={exports:{}};r[i][0].call(l.exports,function(e){var n=r[i][1][e];return o(n?n:e)},l,l.exports,e,r,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;t.length>i;i++)o(t[i]);return o}({fZAVm9:[function(e,r){function n(e){function r(e){for(var r=e||(1,eval)("this"),t=n.length,o=0;t>o;o+=1)r&&(r=r[n[o]]);return r}var n;return e=e.replace(/\[(\d+)\]/g,".$1"),n=e.split("."),arguments.length>1?r(arguments[1]):r}r.exports=n},{}],selectn:[function(e,r){r.exports=e("fZAVm9")},{}]},{},[]);var selectn=require("selectn"),talk={info:{name:"Go Ahead, Make a Mess"}},talk=selectn("info.name",talk);console.log(talk);
<style type='text/css'>html, body { margin: 0; padding: 0; border: 0; }
body, html { height: 100%; width: 100%; }</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment