Registry / devops / codesandboxer

codesandboxer

JSON →
library1.0.3jsnpmunverified

Codesandboxer (v1.0.3) is a utility to fetch files from a Git repository (GitHub or Bitbucket) and generate a CodeSandbox. It automatically resolves relative imports and extracts external dependencies from the package.json, producing a sandbox ID/URL. The release cadence is low; the package is stable but no longer actively maintained. It differs from manual sandbox creation by automating dependency discovery and file fetching.

npm install codesandboxer
INSTALL
IMPORT
SIG · CODESANDBOXER
C
codesandboxer
devopsjavascriptv1.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

fetchFiles
import { fetchFiles } from 'codesandboxer'
const fetchFiles = require('codesandboxer').fetchFiles
Package is ESM-only. Named export, not default.
finaliseCSB
import { finaliseCSB } from 'codesandboxer'
import finaliseCSB from 'codesandboxer'
Named export, not default.
sendFilesToCSB
import { sendFilesToCSB } from 'codesandboxer'
Named export. Returns Promise with { sandboxId, sandboxUrl }.
default
import codesandboxer from 'codesandboxer'
const codesandboxer = require('codesandboxer')
Default export is the main function? Not documented. Prefer named exports.

Fetches files from a GitHub repository, finalizes them for CodeSandbox, and uploads to get a sandbox ID and URL.

import { fetchFiles, finaliseCSB, sendFilesToCSB } from 'codesandboxer'; async function createSandbox() { const fetchedInfo = await fetchFiles({ examplePath: 'fixtures/simple', gitInfo: { host: 'github', account: 'Noviny', repository: 'codesandboxer', branch: 'master', }, }); const finalised = finaliseCSB(fetchedInfo); const csbInfo = await sendFilesToCSB(finalised.parameters); console.log('Sandbox ID:', csbInfo.sandboxId); console.log('Sandbox URL:', csbInfo.sandboxUrl); }
Debug
Known issues
breakingRequired 'node-fetch' peer dependency not installed. fetchFiles will throw 'Cannot find module'.
fix
Run 'npm install node-fetch'.
affects: >=1.0.0
gotchaexamplePath must be relative to the repository root, not the current working directory.
fix
Ensure examplePath does not start with '/' or './' and is relative to git root.
affects: >=1.0.0
gotchaBranch defaults to 'master'; if your default branch is 'main' or different, you must specify it in gitInfo.branch.
fix
Add branch: 'main' to gitInfo.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: fetchFiles is not a function
Importing default instead of named export.
fix
Use 'import { fetchFiles } from 'codesandboxer''.
Error: Cannot find module 'node-fetch'
Missing peer dependency node-fetch.
fix
Install node-fetch with 'npm install node-fetch'.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies
node-fetchrequiredUsed for fetching files from GitHub/Bitbucket APIs in Node.js environments.
Agent activity
4 hits · last 30 days
node
4
Resources
codesandboxer — npm install codesandboxer · libregistry