-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require Node.js 18, move to ESM and named exports #31
Conversation
0895262
to
da6d03c
Compare
example.js
Outdated
const aperture = require('.'); | ||
import fs from 'node:fs'; | ||
import timers from 'node:timers/promises'; | ||
import {aperture, screens, audioDevices, videoCodecs} from './index.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import {aperture, screens, audioDevices, videoCodecs} from './index.js'; | |
import {recorder, screens, audioDevices, videoCodecs} from './index.js'; |
Would make more sense to name it recorder
, since we're doing changes anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about exporting the Recorder
class? Not sure about the demos example naming
const recorder = new Recorder()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cannot record two things at once, so I don't think being able to create a new instance is very useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I exported a Recorder
instance named recorder
.
da6d03c
to
333378b
Compare
333378b
to
588b46e
Compare
Thank you 🙏 |
Followed ESM docs and your work on other projects.
API Breaking changes:
const aperture = require('aperture')
→import {recorder} from 'aperture'
await aperture().startRecording()
→await recorder.startRecording
aperture.screens
→import {screens} from 'aperture'
aperture.audioDevices
→import {audioDevices} from 'aperture'
aperture.videoCodecs
→import {videoCodecs} from 'aperture'
ava
,file-type
,xo
andelectron-util
last versions require Node 18 so I couldn't use them. Do you think it's worth upgrading to Node 18 now?