
Security News
The Code You Didn't Write Is Still Yours to Defend
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.
foreign-country-utils
Advanced tools
// 初始化 const camera = new Camera({ containerCanvas: canvas, customVideoConfig: {}, // 自定义视频配置 customAudioConfig: {}, // 自定义声音配置 callBack: (e:Blob) => { // todo something } })
// 初始化
const camera = new Camera({
containerCanvas: canvas,
customVideoConfig: {}, // 自定义视频配置
customAudioConfig: {}, // 自定义声音配置
callBack: (e:Blob) => {
// todo something
}
})
camera.startVideoStream(); // 开启视频流
camera.startAudioStream(); // 开启语音流
camera.close(); // 停止画面但不停止录像
camera.show(); // 开始/继续展示画面
camera.startRecord(option:{}); // option:MediaRecorderOptions , 开始录制
camera.pauseRecord(isPause); // isPause:boolean(是否停止播放) , 暂停录制
camera.resumeRecord(); // 继续录制
camera.stopRecord(isClose); //isClose:boolean(是否关闭视频), 停止录制,可以关闭视频
camera.scale(ratio); //ratio:number = 1.1(和上一次相比放大倍数), 放大
camera.spin(angle); //angle:number = 45(和上一次旋转角度), 旋转
const buffer = base64ToBuffer(base64String); base64String: string, base64字符串
const color = createColor(); 16位颜色,如: #ff5645
const http = new Http(baseURL,timeout);
// isUrlencoded为是否使用content-type为application/x-www-form-urlencoded,默认为false
const promiseObj = http.get<T>(url,data,{自定义配置},isUrlencoded) // get请求
const promiseObj = http.post<T>(url,data,{自定义配置},isUrlencoded) // post请求
const promiseObj = http.delete<T>(url,data,{自定义配置},isUrlencoded) // delete请求
const promiseObj = http.put<T>(url,data,{自定义配置},isUrlencoded) // put请求
const promiseObj = http.patch<T>(url,data,{自定义配置},isUrlencoded) // patch请求
const promiseObj = http.upload<T>(url,data:FormData,{自定义配置}) // post请求,发送文件(formdata类型)
const promiseObj = http.cancel((key?:string) // key为取消的是哪一次请求,不传则取消全部请求,并清空map
const {get,set} = storage();
key: 取出的键名, toJson是否需要转成JSON对象,默认是,fromSession:是否从session取值,默认是
const obj: Record<string, T> | string | null = get<T>(key: string, toJson = true, fromSession = true);
key: 需要保存的键名, value要保存的值,toSession:是否存入session,默认是
const result: boolean = set(key: string, value: string | boolean | number | null | Record<string, unknown>, toSession = true);
FAQs
// 初始化 const camera = new Camera({ containerCanvas: canvas, customVideoConfig: {}, // 自定义视频配置 customAudioConfig: {}, // 自定义声音配置 callBack: (e:Blob) => { // todo something } })
The npm package foreign-country-utils receives a total of 253 weekly downloads. As such, foreign-country-utils popularity was classified as not popular.
We found that foreign-country-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.