Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

Commit

Permalink
Final Release
Browse files Browse the repository at this point in the history
  • Loading branch information
iim-ayush committed Nov 26, 2021
1 parent ee3a3c8 commit a871f5f
Show file tree
Hide file tree
Showing 9 changed files with 1,609 additions and 165 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ build
node_modules
main.js
.vscode
dist
dist
play-opus
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Play-opus

Native bindings of libopus in node JS.

14 changes: 14 additions & 0 deletions lib/build.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import fs from 'fs'

if(fs.existsSync('./play-opus')) fs.rmSync('./play-opus', { recursive : true })
fs.mkdirSync('./play-opus')
if(!fs.existsSync('./build/Release')) {
console.log('\nNo Build Files found. Report to the developer.')
process.exit(1)
}
const opusFiles = fs.readdirSync('./build/Release').filter((x) => x.startsWith('opus'))
opusFiles.forEach((file) => {
fs.copyFileSync(`./build/Release/${file}`, `./play-opus/${file}`)
})
fs.copyFileSync('./src/opus.d.ts', './play-opus/opus.d.ts')
fs.rmSync('./build', { recursive : true })
46 changes: 1 addition & 45 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1 @@
// async function main() {
// /* using 20 to make the progress bar length 20 charactes, multiplying by 5 below to arrive to 100 */

// for (let i = 0; i <= 20; i++) {
// const dots = ".".repeat(i)
// const left = 20 - i
// const empty = " ".repeat(left)

// /* need to use `process.stdout.write` becuase console.log print a newline character */
// /* \r clear the current line and then print the other characters making it looks like it refresh*/
// process.stdout.write('\x1B[?25l')
// process.stdout.write(`\r[${dots}${empty}] ${i * 5}%`)
// await wait(80)
// }
// process.stdout.write('\x1B[?25h')
// console.log(process.stdout.columns)
// }

// main()

// function wait(ms : number) {
// return new Promise(res => setTimeout(res, ms))
// }

// import { spawn } from 'child_process'

// const x = spawn('node-gyp', ['build'], { shell : true })

// let count = 0

// x.stdout.on('data', (x) => console.log(++count))

// x.stderr.on('data', (y) => console.log(y.toString('utf-8')))

// x.on('error', (s) => console.log('ERROR :' + s))

// Configure = 12
// Build = 168
// Creating new dir = 1
// Moving = 1

import { ProgressBar } from './progressbar'

const x = new ProgressBar('Title' , ['T 1', 'T 22222222'], 10)
x.cursor.unhide()
export { OpusHandler } from '../play-opus/opus'
105 changes: 0 additions & 105 deletions lib/progressbar.ts

This file was deleted.

Loading

0 comments on commit a871f5f

Please sign in to comment.