Library to download binary files from GitHub releases detecting the correct platform.

Overview

Dbin

TypeScript library to download binary files from GitHub releases detecting the correct platform. Example:

import dbin from "https://deno.land/x/dbin/mod.ts";

const binfile = await dbin({
  pattern:
    "https://github.com/CloudCannon/pagefind/releases/download/{version}/pagefind-{version}-{target}.tar.gz",
  version: "v0.8.1",
  targets: [
    { name: "x86_64-unknown-linux-musl", os: "linux", arch: "x86_64" },
    { name: "x86_64-apple-darwin", os: "darwin", arch: "x86_64" },
    { name: "x86_64-pc-windows-msvc", os: "windows", arch: "x86_64" },
  ],
  dest: "./_bin/pagefind",
});

This function does the following:

  • Detects the current target (for example, for linux and x86_64 the target is x86_64-unknown-linux-musl).
  • Replace the variables {version} and {target} in the patternurl.
  • Download the file.
  • Decompress the .tar.gz file.
  • Output to the dest file (./_bin/pagefind in the example). If the current os is Windows, the .exe extension is appended to the file name.
  • Change the output file permissions to 0o764 (except in Windows). Set the chmod option for other value compatible with Deno.chmod.
  • Returns the full path to the executable file.
  • If the function is executed again, and the dest file exists, it does nothing. Set override: true to download the file again.
You might also like...

It shows an effective way to correct bus arrival information using data analytics based on Amazon Serverless such as Kiness Data Stream, Kinesis Data Firehose, S3, and Lambda.

It shows an effective way to correct bus arrival information using data analytics based on Amazon Serverless such as Kiness Data Stream, Kinesis Data Firehose, S3, and Lambda.

Amazon Serverless를 이용한 실시간 버스 정보 수집 및 저장 본 github repository는 버스 정보를 주기적으로 수집하여 분석할 수 있도록, Amazon Serverless인 Amazon Kinesis Data Stream, Kinesis Data

Nov 13, 2022

For some realizations of the title and thinking of the book Introduction to Algorithms, if there is something wrong, please correct me.

Introduction-to-Algorithms Introduce Origin of this library Some implementations of the topics in Introduction to Algorithms and some reflections on t

Jun 9, 2022

Click in your components and open VSCode in the correct file and line number.

Click in your components and open VSCode in the correct file and line number.

Inspect in VSCode This is a simple extension for deno/fresh projects that allows you to inspect your components' source code in VSCode. This repositor

Nov 30, 2022

In this project, I built a to-do list app, which is inspired by the minimalist website. Build withHTML/CSS & JavaScript best practices: Correct use of tags, elements, properties and syntax.

Webpack Exercise In this project, I built a to-do list app, which is inspired by the minimalist website. Built With HTML/CSS & JavaScript best practic

Oct 11, 2022

Binary-encoded serialization of JavaScript objects with generator-based parser and serializer

YaBSON Schemaless binary-encoded serialization of JavaScript objects with generator-based parser and serializer This library is designed to transfer l

Aug 9, 2022

ltp is a parseless copyfree binary encoding format

ltp is a parseless copyfree binary encoding format. This means that you can read a field out of ltp encoded data without

Aug 10, 2022

Glorious Binary Serialization and Deserialization for TypeScript.

Glorious Binary Serialization and Deserialization for TypeScript.

Glorious SerDes for TypeScript The library you can rely on, For binary serialization and deserialization, In Node, Deno, and the Web environment, Whic

Dec 11, 2022

shell script replacement; write shell scripts in js instead of bash, then run them with a single static binary

yavascript YavaScript is a bash-like script runner which is distributed as a single statically-linked binary. Scripts are written in JavaScript. There

Dec 29, 2022

A file sharing service, where you can upload files and provide a download link for anyone on the internet by sharing the link 🔗 or via mail ✉️ which remains active for 24hours 🕙.

eShare | File Sharing App A file sharing service, where you can upload files and provide a download link for anyone on the internet by sharing the lin

Nov 20, 2022
Releases(v0.2.0)
Owner
Óscar Otero
Web designer and developer 🦄
Óscar Otero
Copy/paste detecting GitHub Action for programming source code (jscpd)

dry-code Copy/paste detecting GitHub Action for programming source code with jscpd Action inputs Action input Description Default Value Required optio

null 5 Dec 14, 2022
💅 A ready-to-go with a well-thought-out structure Electron app boilerplate with ReactJS, TypeScript, CSS / SASS modules, SWC, Eslint, Prettier, GitHub Action releases and more.

Electron App ??  A ready-to-go with a well-thought-out structure Electron app boilerplate with ReactJS, TypeScript, CSS / SASS modules, SWC, Eslint, P

Dalton Menezes 155 Dec 29, 2022
Download all Moodle files with one click. This is a Chrome extension built to save time and effort from downloading files manually one by one!

Moodle Downloader Extension Moodle downloader extension for Chrome. The extension is tested with both the TUM moodle and the official moodle demo. Not

Zhongpin Wang 8 Nov 15, 2022
A ScrollSpy library for detecting enter/exit of elements in the viewport when the user scrolls

jquery-scrollspy A jQuery plugin for detecting enter/exit of elements in the viewport when the user scrolls. New Features Added a couple new features:

John Smart 276 Jul 1, 2022
TS & JS Library for adaptive precision cursor for the web. Releases will come out soon! Meanwhile, check out the demo site:

Haha, cool cursor go brrrr... Table of Content What is this? Installation & Setup Installation Setup Usage Cursor controls Element settings Known issu

LemonOrange 10 Nov 24, 2022
A website for detecting name of bank from card number, supported all Iranian banks

Detect Iranian Bank Web A website for detecting name of bank from card number, supported all Iranian banks. This package contains SVG logo and brand c

Max Base 12 Oct 2, 2022
Improve the security of your API by detecting common vulnerabilities as defined by OWASP and enforced with Spectral.

Spectral OWASP API Security Scan an OpenAPI document to detect security issues. As OpenAPI is only describing the surface level of the API it cannot s

Stoplight 23 Dec 8, 2022
🪵 Aggressively find a packages changelog (or releases) between versions.

?? changelogd Aggressively find a packages changelog (or releases) between versions. Status: Early Access Please report any issues ?? Made possible by

Harlan Wilton 8 May 10, 2022
Smart Auto Move learns the size and position of your application windows and restores them to the correct place on subsequent launches. Supports GNOME Wayland.

smart-auto-move smart-auto-move is a Gnome Shell extension which keeps track of all application windows and restores them to the previous position, si

khimaros 40 Dec 23, 2022
🚨 Make the case correct, PLEASE!

?? CasePolice GitHub, not Github TypeScript, not Typescript macOS, not MacOS VS Code, not Vscode ... Make the case correct, PLEASE! Usage Make sure yo

Anthony Fu 944 Dec 26, 2022