1.2.1 • Published 19 days ago

memcode v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
19 days ago

memcode

Organize your filles and download them in your browser.

Installation

pnpm i memcode

Usage

import { MemCode } from 'memcode'

// add files when creating
const code = new MemCode([{
  name: 'src/index.ts',
  content: 'console.log("hello world")'
}])

// add
code.add('package.json', JSON.stringify({
  name: 'hello world'
}))

// add also support directory
code.add('/src/index.ts', 'console.log("hello world")')
code.add('/src/foo/bar.ts', 'console.log("hello foo bar"')

// update
code.update('src/index.ts', 'const a = 1')

// remove
code.remove('src/index.ts')

// To zip
const blob = await code.toZipBlob()

// Download zip
code.downloadZip(blob, 'memcode.zip')

License

MIT

1.2.1

19 days ago

1.2.0

25 days ago

1.1.0

26 days ago

1.0.0

26 days ago

0.0.0

26 days ago