
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
@odata/client
Advanced tools
Javascript OData Client for OData (v2/v4) Service.
npm i -S @odata/client
Alternative, in native browser environment, just add unpkg or jsdeliver umd link to your page, and the OData
object will be available in window
.
<script src="https://cdn.jsdelivr.net/npm/@odata/client/lib/odata-client-umd.js"></script>
How to use
@odata/client
Start with a simple query, following code start a GET
http request, and asks the server to respond to all customers which phone number equals 030-0074321
import { OData } from "@odata/client"
// import "@odata/client/lib/polyfill" // server side polyfill
// odata.org sample odata service
const serviceEndpoint = "https://services.odata.org/V2/Northwind/Northwind.svc/"
const client = OData.New({ serviceEndpoint })
const runner = async () => {
// Query by filter
//
// GET /Customers?$format=json&$filter=Phone eq '030-0074321'
const filter = client.newFilter().property("Phone").eq("030-0074321");
// just an example, suggest to use the EntitySet API
const result = await client.newRequest({ // ODataRequest object
collection: "Customers", // entity set
params: client.newParam().filter(filter) // odata param
})
}
// OData V4 client
const client = OData.New4({ serviceEndpoint: "https://odata-v4-demo-001.herokuapp.com/odata/" })
use SystemQueryOption
to control response size
, element projection
and order
use the ODataFilter
to filter data
use EntitySet
to perform CRUD
on a specific entity
use odata $batch
api for operating multi entities in single HTTP request, it will save a lot of time between client & server (In the case of processing a large number of requests).
some advanced topics
FAQs
OData(V2/V4) Client
The npm package @odata/client receives a total of 2,411 weekly downloads. As such, @odata/client popularity was classified as popular.
We found that @odata/client 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.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.