![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Fault-tolerant hal+json parser and writer.
npm install halson --save
var hal = require('halson');
var resource = new hal.Resource({name: "Harry"}, '/harry');
resource.link('next', '/johnnie');
resource.link('avatar', {
type: 'image/png',
href: '/avatars/harry.png'
});
var company = new hal.Resource({name: "Acme co."}, {
href: '/acme',
profile: 'http://microformats.org/wiki/microformats2',
type: 'text/html'
});
resource.curie('ex', '/doc/rels/{rel}');
resource.embed('ex:company', company);
console.log(resource.toJSON('\t'));
var hal = require('halson');
var data = '{"title":"Lorem Ipsum","_links":{"self":{"href":"/lorem"}}}';
var resource = hal.parse(data);
console.log(resource.get('title'));
// Lorem Ipsum
console.log(resource.link('self'));
// { href: '/lorem' }
Resource(object, selfLink)
Creates new resource object.
object
(optional): attributes of resourceselfLink
(optional): self-link as a string or a link objectResource#link(rel, link)
Adds a link.
rel
: relation namelink
: link (object or string)Resource#curie(name, template)
Adds a named CURIE template.
name
: CURIE's nametemplate
: CURIE's templateResource#embed(rel, embed)
Adds an embedded resource.
rel
: relation nameembed
: resource to be embedded (object or Resource)Resource#set(key, value)
Sets resource attribute.
Resource#toObject()
Converts resource to a Javascript Object.
Resource#toJSON(space)
Converts resource to a serialized JSON string.
parse(data)
Parse data (serialized JSON string or an Object) and returns instance of ParsedResource
.
ParsedResource#get(key)
Reads resource attribute.
ParsedResource#self(attribute)
Reads attribute of self-relation link.
ParsedResource#links(rel)
Returns all links with relation rel
.
ParsedResource#link(rel)
Returns first link with relation rel
.
ParsedResource#linkByName(rel, name)
Returns first link with relation rel
and name name
.
ParsedResource#embeds(rel)
Returns all embedded resources with relation rel
.
ParsedResource#embed(rel)
Returns first embedded resource with relation rel
.
ParsedResource#embedByURI(rel, uri)
Returns embedded resource with relation rel
and self-link URI uri
.
FAQs
The HAL+JSON Resource Object
The npm package halson receives a total of 5,214 weekly downloads. As such, halson popularity was classified as popular.
We found that halson demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.