Recorder
JavaScript library for Audio(s), Video(s) stream mixing and recording.
Folder structure
The 'recorder' library folder consists of the following structure -
- src folder - having the .js files related to the library that will export various JavaScript functions. It will also have the corresponding declaration(.d.ts) and map(.d.ts.map) files needed for typescript based projects, generated after compiling the code(npx tsc).
- package.json file - with all the required dependencies
- tsconfig.json file - Configurations for generating the (.d.ts) declaration files needed for typescript or angular project. The declaration and map files will be generated after compiling the library code by using 'npx tsc' command.
- README.md file
- LICENSE file
- package-lock.json file - Will be generated after running 'npm install' command.
- node_modules folder - Will be generated after running 'npm install' command.
How to include the library?
-
You need to include this compiled folder inside your project inside the 'src' or the 'src/app' folder.
-
Refer to path of this library folder's package.json inside the package.json of your main project under the dependencies section. For example:
"dependencies": {
"recorder-library": "file:./src/recorder"
},When you run 'npm install' from your main project, the library's dependencies will also get installed along with the other dependencies needed for your main project.
How to use the functions exported from the library?
- For React.js project: Specify only the file's path without extension.
Example:
import { func1, func2, ...} from '../src/recorder/src/index';
import { func1, func2, ... } from './recorder/src/file1'; - For Angular project: Specify only the file's path without extension.
Example:
import { func1, func2, ... } from './recorder/src/file1';
import { func1, func2, ... } from './recorder/src/file2';