geo.usState
This function finds a state, the district or a territory by its FIPS code (`"06"`) or its postal code (`"CA"` or `"ca"`).
CLI- Package
- @procedures/geo · README
- Path
["geo","usState"]- CLI
mark geo usState --code <string>- As data
{"$proc":["geo","usState"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/geo/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["geo","usState"], { code: "<code>" });
console.log(JSON.stringify(result));From the command line
$ mark geo usState --code <string>
As data, in a program
{ "$proc": ["geo", "usState"], "input": { "code": "<code>" } }Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
code | string | yes |
Output
The schema does not list fields (object | null).
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"code": {
"type": "string"
}
},
"required": [
"code"
],
"additionalProperties": false
},
"output": {
"anyOf": [
{
"type": "object",
"properties": {
"fips": {
"type": "string",
"description": "The FIPS code of the Census Bureau, two digits, for example `\"06\"`."
},
"usps": {
"type": "string",
"description": "The code of the Postal Service, two capital letters, for example `\"CA\"`."
},
"name": {
"type": "string",
"description": "The name, for example `\"California\"`."
},
"kind": {
"type": "string",
"enum": [
"district",
"state",
"territory"
]
}
},
"required": [
"fips",
"usps",
"name",
"kind"
],
"additionalProperties": {}
},
{
"type": "null"
}
]
}
}