{"id":25155294,"url":"https://github.com/zxbing0066/z-sandbox","last_synced_at":"2025-04-30T08:23:32.304Z","repository":{"id":35206556,"uuid":"215957833","full_name":"ZxBing0066/z-sandbox","owner":"ZxBing0066","description":"A simple Sandbox implementation for Javascript","archived":false,"fork":false,"pushed_at":"2023-02-03T05:02:15.000Z","size":2791,"stargazers_count":33,"open_issues_count":10,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T00:05:58.515Z","etag":null,"topics":["javascript","sandbox"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZxBing0066.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-18T06:41:23.000Z","updated_at":"2025-01-07T16:05:55.000Z","dependencies_parsed_at":"2023-02-18T03:31:00.600Z","dependency_job_id":null,"html_url":"https://github.com/ZxBing0066/z-sandbox","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZxBing0066%2Fz-sandbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZxBing0066%2Fz-sandbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZxBing0066%2Fz-sandbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZxBing0066%2Fz-sandbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZxBing0066","download_url":"https://codeload.github.com/ZxBing0066/z-sandbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251667168,"owners_count":21624443,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","sandbox"],"created_at":"2025-02-09T00:51:12.250Z","updated_at":"2025-04-30T08:23:32.282Z","avatar_url":"https://github.com/ZxBing0066.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A simple Sandbox implementation for JavaScript\n\n## Preview\n\n![preview](static/preview.gif)\n\n## Demo\n\n[![Edit quirky-microservice-8oqog](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/quirky-microservice-8oqog?fontsize=14)\n\n## How to use\n\n### Install from the npm\n\n```bash\nnpm install z-sandbox\n# or\nyarn add z-sandbox\n```\n\n### Use in your code\n\n```javascript\nimport { createSandbox } from 'z-sandbox';\n\nconst sandboxOptions = {\n    // default: false\n    useStrict: false,\n    // default: true\n    inheritGlobal: true,\n    // default: []\n    blacklist: ['blacklistContent']\n};\n\nconst context = {\n    blacklistContent: \"this content is in the blacklist, you can't get it in the sandbox\",\n    hello: 'hello z-sandbox'\n};\n\nconst sandbox = createSandbox(context, sandboxOptions);\n\nsandbox`\n    // should be undefined\n    console.log(blacklistContent);\n    // should be undefined\n    console.log(window.blacklistContent);\n    // should be undefined\n    console.log(this.blacklistContent);\n    // should be undefined\n    console.log(self.blacklistContent);\n\n    // should be 'hello z-sandbox'\n    console.log(hello);\n\n    window.testInject = true;\n    // should be true\n    console.log(window.testInject);\n`;\n// should be undefined, false\nconsole.log(window.testInject, 'testInject' in window);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzxbing0066%2Fz-sandbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzxbing0066%2Fz-sandbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzxbing0066%2Fz-sandbox/lists"}