
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
An ajax library you need a microscope to see.
Weighs in at 620 bytes gzipped and minified. It is very basic, but contains support for cross-domain requests back to somewhat older browsers (See Compatibility).
v0.4.0
v0.2.1
, and is the only way to use POST
requests.You can use npm or bower:
npm install --save nanoajax
bower install --save nanoajax
Can be used via browserify or webpack:
var nanoajax = require('nanoajax')
Or you can use the global script:
<script src="/nanoajax.min.js"></script>
(You can build that script with: npm install -g uglify-js && ./make
)
GET
nanoajax.ajax({url:'/some-get-url'}, function (code, responseText) { ... })
POST
nanoajax.ajax({url: '/some-post-url', method: 'POST', body: 'post=content&args=yaknow'}, function (code, responseText, request) {
# code is response code
# responseText is response body as a string
# request is the xmlhttprequest, which has `getResponseHeader(header)` function
})
var xhrRequest = nanoajax.ajax(params, callback)
Simple and small ajax function. Takes a parameters object and a callback function.
Parameters:
url
: string, requiredheaders
: object of {header_name: header_value, ...}
body
:
method
: 'GET', 'POST', etc. Defaults to 'GET' or 'POST' based on bodycors
: If your using cross-origin, you will need this true for IE8-9 (to use the XDomainRequest object, also see Compatibility)The following parameters are passed directly onto the request object:
IMPORTANT NOTE: The caller is responsible for compatibility checking.
responseType
: string, various compatability, see xhr docs for enum optionswithCredentials
: boolean, IE10+, CORS onlytimeout
: long, ms timeout, IE8+onprogress
: callback, IE10+Callback function prototype:
statusCode
: integer status or null
response
is "Error")response
:
responseType
set and supported by browser, this is an object of some type (see docs)"Abort"
"Timeout"
"Error"
Returns the request object. So you can call .abort() or other methods
nanoajax
works on android, iOS, IE8+, and all modern browsers, with some (known) caveats.
MIT found in LICENSE
file.
FAQs
A small ajax lib
We found that nanoajax demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.