{"action":"opened","number":1,"pull_request":{"url":"https://api.github.com/repos/maxogden/dat-core/pulls/1","id":32041052,"html_url":"https://github.com/maxogden/dat-core/pull/1","diff_url":"https://github.com/maxogden/dat-core/pull/1.diff","patch_url":"https://github.com/maxogden/dat-core/pull/1.patch","issue_url":"https://api.github.com/repos/maxogden/dat-core/issues/1","number":1,"state":"open","locked":false,"title":"allow passing a levelup instead of dir","user":{"login":"sethvincent","id":164214,"avatar_url":"https://avatars.githubusercontent.com/u/164214?v=3","gravatar_id":"","url":"https://api.github.com/users/sethvincent","html_url":"https://github.com/sethvincent","followers_url":"https://api.github.com/users/sethvincent/followers","following_url":"https://api.github.com/users/sethvincent/following{/other_user}","gists_url":"https://api.github.com/users/sethvincent/gists{/gist_id}","starred_url":"https://api.github.com/users/sethvincent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethvincent/subscriptions","organizations_url":"https://api.github.com/users/sethvincent/orgs","repos_url":"https://api.github.com/users/sethvincent/repos","events_url":"https://api.github.com/users/sethvincent/events{/privacy}","received_events_url":"https://api.github.com/users/sethvincent/received_events","type":"User","site_admin":false},"body":"This helps with browser incompatibility issues I came across with leveldown-prebuilt, `mkdirp`, and `fs.exists` and allows example usage like this:\r\n\r\n```\r\nvar levelup = require('levelup')\r\nvar leveljs = require('level-js')\r\nvar sublevel = require('subleveldown')\r\nvar dat = require('dat-core')\r\n \r\nvar db = levelup('example', { db: leveljs })\r\nvar storage = sublevel(db, 'dat', { valueEncoding: 'json' })\r\nvar example = dat(storage)\r\n \r\nexample.put('hello', { message: 'world' }, function () { // insert value\r\n  example.get('hello', function (err, result) {\r\n    console.log('result:', result)   // prints result\r\n    console.log('db.head:', example.head) // the 'head' of the database graph (a hash)\r\n  })\r\n})\r\n```\r\n\r\nPassing a dir as first option still works.","created_at":"2015-03-26T17:30:22Z","updated_at":"2015-03-26T17:30:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/maxogden/dat-core/pulls/1/commits","review_comments_url":"https://api.github.com/repos/maxogden/dat-core/pulls/1/comments","review_comment_url":"https://api.github.com/repos/maxogden/dat-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/maxogden/dat-core/issues/1/comments","statuses_url":"https://api.github.com/repos/maxogden/dat-core/statuses/ffc1691dba4da5b6e6f8b234297d42cbadfd6b67","head":{"label":"sethvincent:master","ref":"master","sha":"ffc1691dba4da5b6e6f8b234297d42cbadfd6b67","user":{"login":"sethvincent","id":164214,"avatar_url":"https://avatars.githubusercontent.com/u/164214?v=3","gravatar_id":"","url":"https://api.github.com/users/sethvincent","html_url":"https://github.com/sethvincent","followers_url":"https://api.github.com/users/sethvincent/followers","following_url":"https://api.github.com/users/sethvincent/following{/other_user}","gists_url":"https://api.github.com/users/sethvincent/gists{/gist_id}","starred_url":"https://api.github.com/users/sethvincent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethvincent/subscriptions","organizations_url":"https://api.github.com/users/sethvincent/orgs","repos_url":"https://api.github.com/users/sethvincent/repos","events_url":"https://api.github.com/users/sethvincent/events{/privacy}","received_events_url":"https://api.github.com/users/sethvincent/received_events","type":"User","site_admin":false},"repo":{"id":32893003,"name":"dat-core","full_name":"sethvincent/dat-core","owner":{"login":"sethvincent","id":164214,"avatar_url":"https://avatars.githubusercontent.com/u/164214?v=3","gravatar_id":"","url":"https://api.github.com/users/sethvincent","html_url":"https://github.com/sethvincent","followers_url":"https://api.github.com/users/sethvincent/followers","following_url":"https://api.github.com/users/sethvincent/following{/other_user}","gists_url":"https://api.github.com/users/sethvincent/gists{/gist_id}","starred_url":"https://api.github.com/users/sethvincent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethvincent/subscriptions","organizations_url":"https://api.github.com/users/sethvincent/orgs","repos_url":"https://api.github.com/users/sethvincent/repos","events_url":"https://api.github.com/users/sethvincent/events{/privacy}","received_events_url":"https://api.github.com/users/sethvincent/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sethvincent/dat-core","description":"","fork":true,"url":"https://api.github.com/repos/sethvincent/dat-core","forks_url":"https://api.github.com/repos/sethvincent/dat-core/forks","keys_url":"https://api.github.com/repos/sethvincent/dat-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sethvincent/dat-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sethvincent/dat-core/teams","hooks_url":"https://api.github.com/repos/sethvincent/dat-core/hooks","issue_events_url":"https://api.github.com/repos/sethvincent/dat-core/issues/events{/number}","events_url":"https://api.github.com/repos/sethvincent/dat-core/events","assignees_url":"https://api.github.com/repos/sethvincent/dat-core/assignees{/user}","branches_url":"https://api.github.com/repos/sethvincent/dat-core/branches{/branch}","tags_url":"https://api.github.com/repos/sethvincent/dat-core/tags","blobs_url":"https://api.github.com/repos/sethvincent/dat-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sethvincent/dat-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sethvincent/dat-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/sethvincent/dat-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sethvincent/dat-core/statuses/{sha}","languages_url":"https://api.github.com/repos/sethvincent/dat-core/languages","stargazers_url":"https://api.github.com/repos/sethvincent/dat-core/stargazers","contributors_url":"https://api.github.com/repos/sethvincent/dat-core/contributors","subscribers_url":"https://api.github.com/repos/sethvincent/dat-core/subscribers","subscription_url":"https://api.github.com/repos/sethvincent/dat-core/subscription","commits_url":"https://api.github.com/repos/sethvincent/dat-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/sethvincent/dat-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/sethvincent/dat-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/sethvincent/dat-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/sethvincent/dat-core/contents/{+path}","compare_url":"https://api.github.com/repos/sethvincent/dat-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sethvincent/dat-core/merges","archive_url":"https://api.github.com/repos/sethvincent/dat-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sethvincent/dat-core/downloads","issues_url":"https://api.github.com/repos/sethvincent/dat-core/issues{/number}","pulls_url":"https://api.github.com/repos/sethvincent/dat-core/pulls{/number}","milestones_url":"https://api.github.com/repos/sethvincent/dat-core/milestones{/number}","notifications_url":"https://api.github.com/repos/sethvincent/dat-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sethvincent/dat-core/labels{/name}","releases_url":"https://api.github.com/repos/sethvincent/dat-core/releases{/id}","created_at":"2015-03-25T21:50:48Z","updated_at":"2015-03-26T16:54:12Z","pushed_at":"2015-03-26T16:54:12Z","git_url":"git://github.com/sethvincent/dat-core.git","ssh_url":"git@github.com:sethvincent/dat-core.git","clone_url":"https://github.com/sethvincent/dat-core.git","svn_url":"https://github.com/sethvincent/dat-core","homepage":null,"size":92,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"maxogden:master","ref":"master","sha":"ab876d3629df63a1f792e6a29bab0d29de691955","user":{"login":"maxogden","id":39759,"avatar_url":"https://avatars.githubusercontent.com/u/39759?v=3","gravatar_id":"","url":"https://api.github.com/users/maxogden","html_url":"https://github.com/maxogden","followers_url":"https://api.github.com/users/maxogden/followers","following_url":"https://api.github.com/users/maxogden/following{/other_user}","gists_url":"https://api.github.com/users/maxogden/gists{/gist_id}","starred_url":"https://api.github.com/users/maxogden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxogden/subscriptions","organizations_url":"https://api.github.com/users/maxogden/orgs","repos_url":"https://api.github.com/users/maxogden/repos","events_url":"https://api.github.com/users/maxogden/events{/privacy}","received_events_url":"https://api.github.com/users/maxogden/received_events","type":"User","site_admin":false},"repo":{"id":31226570,"name":"dat-core","full_name":"maxogden/dat-core","owner":{"login":"maxogden","id":39759,"avatar_url":"https://avatars.githubusercontent.com/u/39759?v=3","gravatar_id":"","url":"https://api.github.com/users/maxogden","html_url":"https://github.com/maxogden","followers_url":"https://api.github.com/users/maxogden/followers","following_url":"https://api.github.com/users/maxogden/following{/other_user}","gists_url":"https://api.github.com/users/maxogden/gists{/gist_id}","starred_url":"https://api.github.com/users/maxogden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxogden/subscriptions","organizations_url":"https://api.github.com/users/maxogden/orgs","repos_url":"https://api.github.com/users/maxogden/repos","events_url":"https://api.github.com/users/maxogden/events{/privacy}","received_events_url":"https://api.github.com/users/maxogden/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maxogden/dat-core","description":"","fork":false,"url":"https://api.github.com/repos/maxogden/dat-core","forks_url":"https://api.github.com/repos/maxogden/dat-core/forks","keys_url":"https://api.github.com/repos/maxogden/dat-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maxogden/dat-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maxogden/dat-core/teams","hooks_url":"https://api.github.com/repos/maxogden/dat-core/hooks","issue_events_url":"https://api.github.com/repos/maxogden/dat-core/issues/events{/number}","events_url":"https://api.github.com/repos/maxogden/dat-core/events","assignees_url":"https://api.github.com/repos/maxogden/dat-core/assignees{/user}","branches_url":"https://api.github.com/repos/maxogden/dat-core/branches{/branch}","tags_url":"https://api.github.com/repos/maxogden/dat-core/tags","blobs_url":"https://api.github.com/repos/maxogden/dat-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maxogden/dat-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maxogden/dat-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/maxogden/dat-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maxogden/dat-core/statuses/{sha}","languages_url":"https://api.github.com/repos/maxogden/dat-core/languages","stargazers_url":"https://api.github.com/repos/maxogden/dat-core/stargazers","contributors_url":"https://api.github.com/repos/maxogden/dat-core/contributors","subscribers_url":"https://api.github.com/repos/maxogden/dat-core/subscribers","subscription_url":"https://api.github.com/repos/maxogden/dat-core/subscription","commits_url":"https://api.github.com/repos/maxogden/dat-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/maxogden/dat-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/maxogden/dat-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/maxogden/dat-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/maxogden/dat-core/contents/{+path}","compare_url":"https://api.github.com/repos/maxogden/dat-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maxogden/dat-core/merges","archive_url":"https://api.github.com/repos/maxogden/dat-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maxogden/dat-core/downloads","issues_url":"https://api.github.com/repos/maxogden/dat-core/issues{/number}","pulls_url":"https://api.github.com/repos/maxogden/dat-core/pulls{/number}","milestones_url":"https://api.github.com/repos/maxogden/dat-core/milestones{/number}","notifications_url":"https://api.github.com/repos/maxogden/dat-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maxogden/dat-core/labels{/name}","releases_url":"https://api.github.com/repos/maxogden/dat-core/releases{/id}","created_at":"2015-02-23T19:56:57Z","updated_at":"2015-03-23T23:41:01Z","pushed_at":"2015-03-05T23:33:25Z","git_url":"git://github.com/maxogden/dat-core.git","ssh_url":"git@github.com:maxogden/dat-core.git","clone_url":"https://github.com/maxogden/dat-core.git","svn_url":"https://github.com/maxogden/dat-core","homepage":null,"size":156,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/maxogden/dat-core/pulls/1"},"html":{"href":"https://github.com/maxogden/dat-core/pull/1"},"issue":{"href":"https://api.github.com/repos/maxogden/dat-core/issues/1"},"comments":{"href":"https://api.github.com/repos/maxogden/dat-core/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/maxogden/dat-core/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/maxogden/dat-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/maxogden/dat-core/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/maxogden/dat-core/statuses/ffc1691dba4da5b6e6f8b234297d42cbadfd6b67"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":60,"deletions":46,"changed_files":1}}