New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

infojobs

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

infojobs

Easy access to the biggest database of job offers in Spain through the Infojobs RESTful API.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

infojobs

A simple library that allows you to access the biggest database of job offers in Spain through the Infojobs RESTful API.

Build Status npm version JavaScript Style Guide

Install

$ npm install infojobs

In order to be able to use this library you must first go to the Infojobs developer site and create an account.

Usage

Basic usage:

const infojobs = require('infojobs')

const search = infojobs({
  id: 'api_id',
  secret: 'api_secret'  
}) // => these credentials are obtained on https://developer.infojobs.net/

search()
  .offer()
  .run()
  .then( response => {
      console.log(response) // => by default you will receive 20 results.  
  }).catch(console.log)

You can narrow the search by passing a literal object containing a query:


search()
  .offer({
    q: 'Java developer',
    province: 'Madrid',
    companyName: 'Santander Group'
  })
  .run()
  .then( response => {
      console.log(response) // => by default you receive 20 results.
  }).catch(console.log)

Some properties accept multiple options, in that case you can pass a property array like so:


search()
  .offer({
    q: ['Java developer', 'Analista'],
    province: ['Madrid', 'Barcelona'],
    companyName: 'Santander Group'
  })
  .run()
  .then( response => {
      console.log(response) // 
  }).catch(console.log)

You can retrieve a specific job offer by specifying its id using the id method:

search()
  .offer()
    .id('jobOfferId234234234414')
  .run()
  .then( reponse => {
      console.log(response)
  }).catch(console.log)

Unless specified, the Infojobs API will return 20 results per query. If you want to loop through all the results you can use the pages() function like so:

  const search = infojobs(credentials)
  const javaJobsInMadrid = search().offer({q: 'java', province: "Madrid"})

  for await (const page of javaJobsInMadrid.pages()) {
    console.log("Page => ", page) //
  }

API

infojobs(credentials[object required], config[object]) [object infojobs]

Initializes the library and performs the authentication.

offer(query[object optional]) [object infojobs]

You can find the list of available query fields here.

id(id[string optional]) [object infojobs]

Specifies a job id.

run() | start() | go() [object Promise]

Executes the query against the Infojobs RESTful API.

pages(from[number optional], until[number optional]) [asyncIterator]

Returns an Async Iterator that allows you to iterate through the pages.

Requirements

Node.js version >=10.0.0.

Contributing

All contributions are welcome.

License

MIT © Alvaro Bernal

Keywords

infojobs

FAQs

Package last updated on 21 Jul 2019

Did you know?

Socket

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.

Install

Related posts