
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
script tag, you need to invoke apis using crud. prefix :<script src="https://unpkg.com/dom-crud@latest/build/index.umd.min.js"></script>
<script>
// using crud as a namespace to invoke methods
crud.methodName(...)
</script>
npm i dom-crud or yarn add dom-crud :import { methodName } from "dom-crud"
// detail usage are below
Before going on, there are some terms you should know :
Sign represents a string contains two character, there are three signs :
== mean overwrite/replace-= mean delete+= mean appendKVS string (short for "Key Value Sign") is a function parameter format in string style what will be used often:there are some [Builtin Keys](#Builtin Keys) for use, every other keys will be used with setAttribute method. Examples :
class-=a b cstyle==color:red;font-size:2remhtml+=<span>hi</span>id==aKVSC string ("C" is short for "Config"), because some keys can have additional configs, details will discuss later. Examples :
id==a?configA=xx&configB=yyKVS object is a function parameter format in object style what will be used often. Examples :
{ 'id==': {value:'a'}}{ 'id==':'a'} is equal to above{ 'class-=': {value: 'a b c'}} or { 'class-=': 'a b c'}{ 'style==': 'color:red;font-size:2rem'}{ 'html+=': '<span>hi</span>'}KVSC object , Example :
config key and value key at the same time if you need to pass configs: { 'text==': { value:"new text", config: {purText: true} }}cdom(htmlTagName, strOrObj1, strOrObj2, strOrObj3, strOrObj4, ...)stringKVS(C) string or KVS(C) object)HtmlElementimport {cdom} from 'dom-crud'
// below will create a dom like this:
// <input type='text' class='center big red' style='font-size:3rem;font-weight:bold'/>
// you can pass only KVS strings
const $input = cdom('input',
'class==center big red',
'style==font-size:3rem;font-weight:bold',
'type==text'
);
// or pass only KVS objects
const $input2 = cdom('input',
{
'class==': 'center big red',
'style==': "font-size:3rem;font-weight:bold",
},
{
'type': 'text'
});
// or mixed
const $input3 = cdom('input',
'class==center big red',
{
'style==': "font-size:3rem;font-weight:bold",
'type==': 'text'
});
rdom(selector)string same as querySelectorHtmlElementimport {rdom} from 'dom-crud'
// when reading single dom, you can chain it
const $input = rdom('.center').rdom('.word').rdom('.c');
rdoms(selector)string same as `querySelectorAllNodeListimport {rdoms} from 'dom-crud'
// multi doms cannot chain
const $inputs = rdoms('input');
udom(dom, strOrObj1, strOrObj2, strOrObj3, strOrObj4, ...);ElementKVS(C) string or KVS(C) objectimport {udom, rdom} from 'dom-crud'
// below will remove all inline styles and then add blue color
udom(rdom('input'), 'style==color:blue;');
// object style
udom(rdom('input'), {
'style==':'color:blue'
});
// below will only remove color and font-size from inline styles if exists
udom(rdom('input'), 'style-=color;font-size')
// object style
udom(rdom('input'), {
'style-=':'color;font-size'
})
// below will append color to inline styles
udom(rdom('input'), 'style+=color:blue;')
// object style
udom(rdom('input'), {
'style+=':'color:blue'
})
ddom(dom)Elementboolean whether or not removed domimport {ddom, rdom} from 'dom-crud'
ddom(rdom('input'));
getCrudConfig()return : global config object
currently, the default global config is very simple as below:
import { getCrudConfig } from 'dom-crud'
const config = getCrudConfig();
console.log(config);
/*
{
text: {
// detailed below
pureText: false
},
// whether log debug info(currently, nothing cumbersome logged)
debug: false
}
*/
updateCrudConfig(config)import { getCrudConfig, updateCrudConfig } from 'dom-crud'
const config = getCrudConfig();
updateCrudConfig({
text: {
pureText: true,
elseConfig: 'yes' // ignored because global config not contains this
},
})
Below list all builtin keys which made dom-crud funny. Remind: any other keys will be used in setAttribute(key, value) :
textThis key modifies text conent in target dom, V(value) should be string. This key's configs as below:
| name | type | description |
|---|---|---|
| pureText | boolean | If your dom content is 100% plain text, set it to true to make performance boost. This config can be changed by global config. |
htmlThis key modifies html content in target dom, V(value) should be string.
domsThis key modifies doms in target dom,V(value) should be one of below :
array contains EmelentNodeListThis key's configs as below:
| name | type | description |
|---|---|---|
| before | Element | Remind: Element should child of parent element |
styleThis key modifies dom inline styles.
classThis key modifies dom classes.
For more keys? Please give me advice🤣
FAQs
let't crud dom but not database
We found that dom-crud 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.