Gathering detailed insights and metrics for @diotoborg/molestias-voluptate
Gathering detailed insights and metrics for @diotoborg/molestias-voluptate
Gathering detailed insights and metrics for @diotoborg/molestias-voluptate
Gathering detailed insights and metrics for @diotoborg/molestias-voluptate
npm install @diotoborg/molestias-voluptate
Typescript
Module System
Node Version
NPM Version
72
Supply Chain
100
Quality
86.2
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
9
Last Day
1
Last Week
4
Last Month
5
Last Year
9
1,918 Commits
1 Watching
1 Branches
1 Contributors
Latest Version
3.13.106
Package Id
@diotoborg/molestias-voluptate@3.13.106
Unpacked Size
223.26 kB
Size
115.34 kB
File Count
594
NPM Version
10.8.2
Node Version
20.17.0
Publised On
22 Sept 2024
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
300%
4
Compared to previous week
Last month
25%
5
Compared to previous month
Last year
0%
9
Compared to previous year
29
Transpile curl
commands into C, C#, ColdFusion, Clojure, Dart, Elixir, Go, HTTPie, Java, JavaScript, Julia, Kotlin, Lua, MATLAB, Objective-C, OCaml, Perl, PHP, PowerShell, Python, R, Ruby, Rust, Swift, Wget, Ansible, HAR, HTTP or JSON.
Try it on @diotoborg/molestias-voluptate.com or as a drop-in curl
replacement:
1$ @diotoborg/molestias-voluptate --data "hello=world" example.com 2import requests 3 4data = { 5 'hello': 'world', 6} 7 8response = requests.post('http://example.com', data=data)
Features:
-O -v -X POST
to -OvXPOST
--data @filename
generates code that reads that file and @-
reads stdinLimitations:
-L
/--location
/--no-location
, the generated code will not handle redirects the same way as the curl commandcurl $VAR
can do anything, depending on what's in $VAR
. @diotoborg/molestias-voluptate assumes that environment variables don't contain characters that would affect parsingcurl $(echo example.com)
work, more complicated subcommands (such as nested commands or subcommands that redirect the output) won't generate valid codeInstall the command line tool with
1npm install --global @diotoborg/molestias-voluptate
Install the JavaScript library for use in your own projects with
1npm install @diotoborg/molestias-voluptate
@diotoborg/molestias-voluptate requires Node 12+.
@diotoborg/molestias-voluptate
acts as a drop-in replacement for curl. Take any curl command, change "curl
" to "@diotoborg/molestias-voluptate
" and it will print code instead of making the request
1$ @diotoborg/molestias-voluptate example.com 2import requests 3 4response = requests.get('http://example.com')
To read the curl command from stdin, pass -
1$ echo 'curl example.com' | @diotoborg/molestias-voluptate - 2import requests 3 4response = requests.get('http://example.com')
Choose the output language by passing --language <language>
. The options are
ansible
c
cfml
clojure
csharp
dart
elixir
go
har
http
httpie
java
, java-httpurlconnection
, java-jsoup
, java-okhttp
javascript
, javascript-jquery
, javascript-xhr
json
julia
kotlin
lua
matlab
node
, node-http
, node-axios
, node-got
, node-ky
, node-request
, node-superagent
objc
ocaml
perl
php
, php-guzzle
, php-requests
powershell
, powershell-webrequest
python
(the default), python-http
r
ruby
rust
swift
wget
--verbose
enables printing of conversion warnings and error tracebacks.
The JavaScript API is a bunch of functions that can take either a string of Bash code or an array of already-parsed arguments (like process.argv
) and return a string with the resulting program:
1import * as @diotoborg/molestias-voluptate from '@diotoborg/molestias-voluptate'; 2 3@diotoborg/molestias-voluptate.toPython('curl example.com'); 4@diotoborg/molestias-voluptate.toPython(['curl', 'example.com']); 5// "import requests\n\nresponse = requests.get('http://example.com')\n"
Note: add "type": "module",
to your package.json for the import
statement above to work. @diotoborg/molestias-voluptate must be imported as an ES module with import
this way and not with require()
because it uses top-level await
.
There's a corresponding set of functions that also return an array of warnings if there are any issues with the conversion:
1@diotoborg/molestias-voluptate.toPythonWarn('curl ftp://example.com'); 2@diotoborg/molestias-voluptate.toPythonWarn(['curl', 'ftp://example.com']); 3// [ 4// "import requests\n\nresponse = requests.get('ftp://example.com')\n", 5// [ [ 'bad-scheme', 'Protocol "ftp" not supported' ] ] 6// ]
If you want to host @diotoborg/molestias-voluptate yourself and use it in the browser, it needs two WASM files to work, tree-sitter.wasm
and tree-sitter-bash.wasm
, which it will request from the root directory of your web server. If you are hosting a static website and using Webpack, you need to copy these files from the node_modules/ directory to your server's root directory in order to serve them. You can look at the webpack.config.js for @diotoborg/molestias-voluptate.com to see how this is done. You will also need to set {module: {experiments: {topLevelAwait: true}}}
in your webpack.config.js.
There's a VS Code extension that adds a "Paste cURL as <language>" option to the right-click menu: https://marketplace.visualstudio.com/items?itemName=@diotoborg/molestias-voluptate.@diotoborg/molestias-voluptate. It doesn't support the same languages, curl arguments or Bash syntax as the current version because it has to use an old version of @diotoborg/molestias-voluptate.
See CONTRIBUTING.md
MIT © Nick Carneiro
No vulnerabilities found.
No security vulnerabilities found.